Skip to content

Commit 0ca73c0

Browse files
committed
ci: store ancillary job parameters in matrix
If we override the job name, we can put additional parameters in the job matrix and GitHub won't display them. Use that to get rid of the ternaries.
1 parent d13e4c2 commit 0ca73c0

File tree

2 files changed

+59
-15
lines changed

2 files changed

+59
-15
lines changed

.github/workflows/build_all.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,16 @@ jobs:
6161

6262
Ubuntu:
6363
if: github.event_name != 'schedule' || github.repository == 'mesonbuild/wrapdb'
64-
runs-on: ${{ matrix.platform == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
64+
name: Ubuntu (${{ matrix.platform }})
65+
runs-on: ${{ matrix.runner }}
6566
needs: sources
6667
strategy:
6768
matrix:
68-
platform: ['x86_64', 'aarch64']
69+
include:
70+
- platform: aarch64
71+
runner: ubuntu-24.04-arm
72+
- platform: x86_64
73+
runner: ubuntu-latest
6974
steps:
7075
- uses: actions/checkout@v5
7176
with:
@@ -91,17 +96,24 @@ jobs:
9196
9297
Alpine:
9398
if: github.event_name != 'schedule' || github.repository == 'mesonbuild/wrapdb'
94-
runs-on: ${{ matrix.platform == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
99+
name: Alpine (${{ matrix.platform }})
100+
runs-on: ${{ matrix.runner }}
95101
needs: sources
96102
strategy:
97103
matrix:
98-
platform: ['x86_64', 'aarch64']
104+
include:
105+
- platform: aarch64
106+
runner: ubuntu-24.04-arm
107+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
108+
- platform: x86_64
109+
runner: ubuntu-latest
110+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'
99111
steps:
100112
- uses: jirutka/setup-alpine@v1
101113
with:
102114
# next two lines: https://github.com/jirutka/setup-alpine/pull/22
103115
arch: ${{ matrix.platform }}
104-
apk-tools-url: ${{ matrix.platform == 'aarch64' && 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878' || 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62' }}
116+
apk-tools-url: ${{ matrix.apk-tools-url }}
105117
packages: >
106118
binutils clang libc-dev fortify-headers make patch cmake git linux-headers pkgconf py3-pip samurai sudo
107119
@@ -245,11 +257,16 @@ jobs:
245257
246258
MacOS:
247259
if: github.event_name != 'schedule' || github.repository == 'mesonbuild/wrapdb'
248-
runs-on: ${{ matrix.platform == 'arm64' && 'macos-14' || 'macos-13' }}
260+
name: MacOS (${{ matrix.platform }})
261+
runs-on: ${{ matrix.runner }}
249262
needs: sources
250263
strategy:
251264
matrix:
252-
platform: ['arm64', 'x86_64']
265+
include:
266+
- platform: arm64
267+
runner: macos-14
268+
- platform: x86_64
269+
runner: macos-13
253270
steps:
254271
- uses: actions/checkout@v5
255272
with:

.github/workflows/sanity_checks.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,19 @@ jobs:
6060
./tools/fake_tty.py ./tools/sanity_checks.py
6161
6262
Ubuntu:
63-
runs-on: ${{ matrix.platform == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
63+
name: Ubuntu (${{ matrix.platform }})
64+
runs-on: ${{ matrix.runner }}
6465
needs: prelude
6566
strategy:
6667
fail-fast: false
6768
matrix:
6869
include:
69-
- platform: x86_64
70-
python: 3.13
7170
- platform: aarch64
71+
runner: ubuntu-24.04-arm
7272
python: 3.8
73+
- platform: x86_64
74+
runner: ubuntu-latest
75+
python: 3.13
7376
steps:
7477
- uses: actions/checkout@v5
7578
with:
@@ -109,12 +112,31 @@ jobs:
109112
./tools/fake_tty.py ./tools/sanity_checks.py TestReleases.test_meson_version_deps
110113
111114
Alpine:
112-
runs-on: ${{ startsWith(matrix.platform, 'x86') && 'ubuntu-latest' || 'ubuntu-24.04-arm' }}
115+
name: Alpine (${{ matrix.platform }})
116+
runs-on: ${{ matrix.runner }}
113117
needs: prelude
114118
strategy:
115119
fail-fast: false
116120
matrix:
117-
platform: ['x86_64', 'x86', 'aarch64', 'armv7', 'riscv64', 'ppc64le']
121+
include:
122+
- platform: aarch64
123+
runner: ubuntu-24.04-arm
124+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
125+
- platform: armv7
126+
runner: ubuntu-24.04-arm
127+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
128+
- platform: ppc64le
129+
runner: ubuntu-24.04-arm
130+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
131+
- platform: riscv64
132+
runner: ubuntu-24.04-arm
133+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
134+
- platform: x86
135+
runner: ubuntu-latest
136+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'
137+
- platform: x86_64
138+
runner: ubuntu-latest
139+
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'
118140
steps:
119141
- uses: actions/checkout@v5
120142
with:
@@ -124,7 +146,7 @@ jobs:
124146
with:
125147
arch: ${{ matrix.platform }}
126148
# https://github.com/jirutka/setup-alpine/pull/22
127-
apk-tools-url: ${{ startsWith(matrix.platform, 'x86') && 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62' || 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878' }}
149+
apk-tools-url: ${{ matrix.apk-tools-url }}
128150
packages: >
129151
binutils clang libc-dev fortify-headers make patch cmake git linux-headers pkgconf py3-pip samurai sudo
130152
@@ -281,12 +303,17 @@ jobs:
281303
python tools/sanity_checks.py
282304
283305
MacOS:
284-
runs-on: ${{ matrix.platform == 'arm64' && 'macos-14' || 'macos-13' }}
306+
name: MacOS (${{ matrix.platform }})
307+
runs-on: ${{ matrix.runner }}
285308
needs: prelude
286309
strategy:
287310
fail-fast: false
288311
matrix:
289-
platform: ['arm64', 'x86_64']
312+
include:
313+
- platform: arm64
314+
runner: macos-14
315+
- platform: x86_64
316+
runner: macos-13
290317
steps:
291318
- uses: actions/checkout@v5
292319
with:

0 commit comments

Comments
 (0)