tests: Split up into separate jobs

This commit is contained in:
Mike A.
2024-09-02 23:10:23 +02:00
parent 3facf5cd27
commit b2363f5f9b
4 changed files with 40 additions and 94 deletions

View File

@@ -5,9 +5,12 @@ on:
push:
jobs:
deploy:
versions:
runs-on: ubuntu-latest
outputs:
py-versions: ${{ steps.supported-versions.outputs.py-versions }}
steps:
- uses: actions/checkout@v4
@@ -22,7 +25,33 @@ jobs:
poetry config virtualenvs.in-project true
poetry install
- uses: wntrblm/nox@2024.04.15
- id: supported-versions
name: Get supported versions
run: echo "py-versions=$(poetry run ./scripts/supported_py_versions.py)" >> "$GITHUB_OUTPUT"
- name: Run unit tests
run: poetry run nox
test:
runs-on: ubuntu-latest
needs: versions
strategy:
matrix:
py-version: ${{ fromJson(needs.versions.outputs.py-versions) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.py-version }}"
- name: Install dependencies
run: |
python -m pip install poetry
poetry config virtualenvs.in-project true
# Only install main dependencies
poetry install --only=test
- name: Run unit tests
run: poetry run pytest