Skip to content

Commit

Permalink
ci: add run-example job
Browse files Browse the repository at this point in the history
  • Loading branch information
kod-kristoff committed May 29, 2024
1 parent b9b831b commit 15d1b40
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,54 @@ jobs:
- name: make test
run: make test

run-example:
name: ubuntu / 3.8 / run-example / ${{ matrix.example-name }}
strategy:
max-parallel: 4
fail-fast: false
matrix:
example-name:
- sparv-sbx-sentence-sentiment-kb-sent
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/${{ matrix.example-name }}
echo "" | sparv setup
sparv run
ls -R
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
test-check:
if: always()
needs:
- coverage
- minimal
- run-example
runs-on: ubuntu-latest
permissions: {}
steps:
Expand Down

0 comments on commit 15d1b40

Please sign in to comment.