Skip to content

Commit c3ae809

Browse files
committed
ci: generate one job per session
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent d0f96aa commit c3ae809

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,40 @@ env:
1515
FORCE_COLOR: 3
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@v3
24+
- uses: henryiii/nox@henryiii/feat/json
25+
- id: set-matrix
26+
run: |
27+
MATRIX=$(
28+
nox --json -l | jq -c '[.[].session]'
29+
)
30+
echo "session=$MATRIX" | tee --append $GITHUB_OUTPUT
31+
1832
checks:
33+
needs: [generate-jobs]
1934
runs-on: ${{ matrix.runs-on }}
2035
strategy:
2136
fail-fast: false
2237
matrix:
2338
runs-on: [ubuntu-latest, macos-latest, windows-latest]
39+
session: ${{ fromJson(needs.generate-jobs.outputs.session) }}
40+
exclude:
41+
- runs-on: windows-latest
42+
session: test(hello-cmake-package)
43+
- runs-on: windows-latest
44+
session: dist(hello-cmake-package)
2445

25-
name: Check on ${{ matrix.runs-on }}
46+
name: Session ${{ matrix.session }} on ${{ matrix.runs-on }}
2647

2748
steps:
2849
- uses: actions/checkout@v3
29-
- uses: wntrblm/nox@main
30-
- run: nox
50+
- uses: wntrblm/nox@2022.11.21
51+
- run: nox -s '${{ matrix.session }}'
3152

3253
pass:
3354
if: always()

0 commit comments

Comments
 (0)