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 <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Mar 3, 2023
1 parent 6fd3904 commit 3e8867c
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,55 @@ on:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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/nox@main
- run: nox
- uses: wntrblm/nox@2022.11.21
- run: nox -s '${{ matrix.session }}'

pass:
if: always()
needs: [checks]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

0 comments on commit 3e8867c

Please sign in to comment.