Skip to content

Commit c49fb3b

Browse files
committed
Use nox to generate test matrix
1 parent f24d057 commit c49fb3b

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,24 @@ on:
1515
- ".github/workflows/tests.yml"
1616

1717
jobs:
18+
generate-jobs:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
session: ${{ steps.set-matrix.outputs.session }}
22+
steps:
23+
- uses: actions/checkout@v6
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
26+
- id: set-matrix
27+
run: echo session=$(uvx nox@2025.11.12 --json -l | jq -c '[.[].session]') | tee --append $GITHUB_OUTPUT
1828
tests:
19-
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }}
20-
runs-on: ${{ matrix.os }}
29+
name: ${{ matrix.session }}
30+
needs: [generate-jobs]
31+
runs-on: ubuntu-latest
2132
strategy:
2233
fail-fast: false
2334
matrix:
24-
include:
25-
- { python: "3.13", os: "ubuntu-latest", session: "pre-commit" }
26-
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
27-
- { python: "3.13", os: "ubuntu-latest", session: "mypy" }
28-
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
29-
- { python: "3.13", os: "ubuntu-latest", session: "tests" }
30-
- { python: "3.13", os: "ubuntu-latest", session: "typeguard" }
31-
- { python: "3.13", os: "ubuntu-latest", session: "xdoctest" }
32-
- { python: "3.13", os: "ubuntu-latest", session: "docs-build" }
35+
session: ${{ fromJson(needs.generate-jobs.outputs.session) }}
3336

3437
env:
3538
NOXSESSION: ${{ matrix.session }}
@@ -39,12 +42,6 @@ jobs:
3942
steps:
4043
- name: Check out the repository
4144
uses: actions/checkout@v6
42-
43-
- name: Set up Python ${{ matrix.python }}
44-
uses: actions/setup-python@v6.1.0
45-
with:
46-
python-version: ${{ matrix.python }}
47-
4845
- name: Install uv
4946
uses: astral-sh/setup-uv@v7
5047
with:

0 commit comments

Comments
 (0)