Skip to content

Commit

Permalink
ci: generate one job per session
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Mar 4, 2023
1 parent 1f22a34 commit 93ec83f
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,40 @@ env:
FORCE_COLOR: 3

jobs:
generate-jobs:
runs-on: ubuntu-latest
outputs:
session: ${{ steps.set-matrix.outputs.session }}
steps:
- uses: actions/checkout@v3
- uses: henryiii/nox@henryiii/feat/json
- id: set-matrix
run: |
MATRIX=$(
nox --json -l | jq -c '[.[].session]'
)
echo "session=$MATRIX" | tee --append $GITHUB_OUTPUT
checks:
needs: [generate-jobs]
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
session: ${{ fromJson(needs.generate-jobs.outputs.session) }}
exclude:
- runs-on: windows-latest
session: test(hello-cmake-package)
- runs-on: windows-latest
session: dist(hello-cmake-package)

name: Check on ${{ matrix.runs-on }}
name: Session ${{ matrix.session }} on ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v3
- uses: wntrblm/[email protected]
- run: nox
- run: nox -s '${{ matrix.session }}'

pass:
if: always()
Expand Down

0 comments on commit 93ec83f

Please sign in to comment.