Skip to content

Commit

Permalink
Try different test strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Apr 25, 2024
1 parent 0897285 commit c7791de
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,34 @@ concurrency:
cancel-in-progress: true

jobs:
generate-matrix:
name: Create Job Matrix
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
modules: ${{ steps.set-matrix.outputs.modules }}

steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
MATRIX=$(ls tests/manager | jq -R -s -c 'split("\n")[:-1]|map(select(endswith(".py")|not))')
echo "modules=$MATRIX"
echo "modules=$MATRIX" >> $GITHUB_OUTPUT
test:
name: Tests (Py ${{ matrix.python-version }})
name: ${{ matrix.module }} Tests (Py ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 60
needs: generate-matrix
timeout-minutes: 30
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
module: ${{ fromJson(needs.generate-matrix.outputs.modules) }}

steps:
- uses: actions/checkout@v4
Expand All @@ -45,15 +63,15 @@ jobs:
POETRY_VIRTUALENVS_CREATE: false

- name: Run Tests
run: tox
run: tox -- tests/${{ matrix.module }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: manager
name: manager-${{ matrix.python-version }}
flags: ${{ matrix.module }}
name: ${{ matrix.module }}-${{ matrix.python-version }}
verbose: true

test-migrations:
Expand Down

0 comments on commit c7791de

Please sign in to comment.