Skip to content

Commit

Permalink
build(ci): use stable job names
Browse files Browse the repository at this point in the history
This means that we can upgrade the os without needing
to update branch protection rules

use 'include' to expand the 'os' matrix to include the name
then use the variable as a job name

https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-expanding-configurations

Fixes 15371
  • Loading branch information
david-allison authored and mikehardy committed Jan 31, 2024
1 parent b0b2d52 commit 75ef22e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/tests_unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ concurrency:

jobs:
unit:
name: JUnit Tests (${{ matrix.os}})
name: JUnit Tests (${{ matrix.name }})
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# macOS 14 is in beta and runs on Apple Silicon [M1]
os: [ubuntu-latest, macos-14, windows-latest]
# define 'name' so we don't need to update branch protection rules if the os changes
include:
- os: ubuntu-latest
name: ubuntu
- os: macos-14
name: macos
- os: windows-latest
name: windows
runs-on: ${{ matrix.os }}
#env:
# CODACY_TOKEN: ${{ secrets.CODACY_TOKEN }}
Expand Down

0 comments on commit 75ef22e

Please sign in to comment.