From c7791de6e0a49da4844b31397e46c8ebac67048c Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Thu, 25 Apr 2024 15:30:34 -0300 Subject: [PATCH] Try different test strategy --- .github/workflows/test.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index abd1ea7cc2..f33dfe2b27 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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: