Skip to content

Commit

Permalink
Matrix over test files.
Browse files Browse the repository at this point in the history
  • Loading branch information
vengroff committed May 25, 2024
1 parent 070b942 commit 23968ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,22 @@ name: test-matrix
on: pull_request

jobs:
# List the tests
list-tests:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.test-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: test-matrix
run: echo "matrix=$(find tests -name "*.py" | sed -e s/^tests\\/// | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
test-matrix:
needs: list-tests
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
test: ${{ fromJson(needs.list-tests.outputs.matrix) }}
fail-fast: false
defaults:
run:
Expand Down Expand Up @@ -55,9 +66,9 @@ jobs:
source $VENV
pytest
- name: Archive test artifacts
if: always()
if: ${{ hashFiles('tests/_test_artifacts') != '' }}
uses: actions/upload-artifact@v4
with:
name: test_artifacts-${{ matrix.os }}-${{ matrix.python-version }}
name: test_artifacts-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test }}
path: tests/_test_artifacts
retention-days: 7
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
workflow_dispatch:

jobs:
# List the notebooks
# List the tests
list-tests:
runs-on: ubuntu-latest
outputs:
Expand Down

0 comments on commit 23968ae

Please sign in to comment.