From 7a5f64db3de5bdb2b604d1789e603c01b947591c Mon Sep 17 00:00:00 2001 From: Kristoffer Andersson Date: Mon, 19 Feb 2024 14:11:14 +0100 Subject: [PATCH] ci: run example --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d1bee1..c870aed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -128,6 +128,41 @@ jobs: run: pdm sync --dev - name: make test run: make test + + run-example: + name: Run example + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + #---------------------------------------------- + # ----- setup python ----- + #---------------------------------------------- + - name: Set up the environment + uses: pdm-project/setup-pdm@v4 + id: setup-python + with: + python-version: ${{ env.MINIMUM_PYTHON_VERSION }} + + + - name: Load cached venv + id: cached-venv + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/ci.yml') }} + + - name: Install dependencies + if: steps.cached-venv.outputs.cache-hit != 'true' + run: make install-dev + + - name: Run example + run: | + source .venv/bin/activate + cd examples/hello-ocr + echo "" | sparv setup + sparv run + ls -R # https://github.com/marketplace/actions/alls-green#why used for branch protection checks test-check: if: always() @@ -135,6 +170,7 @@ jobs: - coverage - minimal - upload-coverage + - run-example runs-on: ubuntu-latest permissions: {} steps: