Skip to content

Commit a3928c4

Browse files
committed
ci: fix matrix usage
1 parent 74773fe commit a3928c4

File tree

1 file changed

+97
-93
lines changed

1 file changed

+97
-93
lines changed

.github/workflows/main.yml

+97-93
Original file line numberDiff line numberDiff line change
@@ -65,122 +65,126 @@ jobs:
6565
test:
6666
needs: [style]
6767
name: Test
68-
runs-on: ${{ matrix.os }}
68+
runs-on: ${{ matrix.target.os }}
6969
strategy:
7070
matrix:
7171
profile:
7272
- dev
7373
- release
7474
target:
7575
# Dockers that are run through docker on linux
76-
- i686-unknown-linux-gnu
77-
- x86_64-unknown-linux-gnu
78-
- x86_64-unknown-linux-gnu-emulated
79-
- arm-unknown-linux-gnueabihf
80-
- armv7-unknown-linux-gnueabihf
81-
- aarch64-unknown-linux-gnu
82-
- riscv64gc-unknown-linux-gnu
83-
- powerpc64le-unknown-linux-gnu
76+
- tuple: i686-unknown-linux-gnu
77+
os: ubuntu-latest
78+
- tuple: x86_64-unknown-linux-gnu
79+
os: ubuntu-latest
80+
- tuple: x86_64-unknown-linux-gnu-emulated
81+
os: ubuntu-latest
82+
- tuple: arm-unknown-linux-gnueabihf
83+
os: ubuntu-latest
84+
- tuple: armv7-unknown-linux-gnueabihf
85+
os: ubuntu-latest
86+
- tuple: aarch64-unknown-linux-gnu
87+
os: ubuntu-latest
88+
- tuple: riscv64gc-unknown-linux-gnu
89+
os: ubuntu-latest
90+
- tuple: powerpc64le-unknown-linux-gnu
91+
os: ubuntu-latest
8492
# MIPS targets disabled since they are dropped to tier 3.
8593
# See https://github.com/rust-lang/compiler-team/issues/648
8694
#- mips-unknown-linux-gnu
8795
#- mips64-unknown-linux-gnuabi64
8896
#- mips64el-unknown-linux-gnuabi64
8997
#- mipsel-unknown-linux-musl
90-
- s390x-unknown-linux-gnu
91-
- wasm32-wasip1
92-
- i586-unknown-linux-gnu
93-
- nvptx64-nvidia-cuda
94-
- thumbv6m-none-eabi
95-
- thumbv7m-none-eabi
96-
- thumbv7em-none-eabi
97-
- thumbv7em-none-eabihf
98-
- loongarch64-unknown-linux-gnu
98+
- tuple: s390x-unknown-linux-gnu
99+
os: ubuntu-latest
100+
- tuple: i586-unknown-linux-gnu
101+
os: ubuntu-latest
102+
- tuple: nvptx64-nvidia-cuda
103+
os: ubuntu-latest
104+
- tuple: thumbv6m-none-eabi
105+
os: ubuntu-latest
106+
- tuple: thumbv7m-none-eabi
107+
os: ubuntu-latest
108+
- tuple: thumbv7em-none-eabi
109+
os: ubuntu-latest
110+
- tuple: thumbv7em-none-eabihf
111+
os: ubuntu-latest
112+
- tuple: loongarch64-unknown-linux-gnu
113+
os: ubuntu-latest
114+
- tuple: wasm32-wasip1
115+
os: ubuntu-latest
99116

100117
# macOS targets
101-
- x86_64-apple-darwin
102-
- aarch64-apple-darwin
118+
- tuple: x86_64-apple-darwin
119+
os: macos-13
120+
- tuple: x86_64-apple-ios-macabi
121+
os: macos-13
122+
- tuple: aarch64-apple-darwin
123+
os: macos-latest
124+
- tuple: aarch64-apple-ios-macabi
125+
os: macos-latest
103126
# FIXME: gh-actions build environment doesn't have linker support
104-
# - i686-apple-darwin
127+
# - tuple: i686-apple-darwin
128+
# os: macos-13
105129

106130
# Windows targets
107-
- x86_64-pc-windows-msvc
108-
- i686-pc-windows-msvc
109-
- aarch64-pc-windows-msvc
110-
- x86_64-pc-windows-gnu
111-
# - i686-pc-windows-gnu:
131+
- tuple: x86_64-pc-windows-msvc
132+
os: windows-latest
133+
- tuple: i686-pc-windows-msvc
134+
os: windows-latest
135+
- tuple: aarch64-pc-windows-msvc
136+
os: windows-latest
137+
- tuple: x86_64-pc-windows-gnu
138+
os: windows-latest
139+
# - tuple: i686-pc-windows-gnu
140+
# os: windows-latest
112141

142+
# Add additional variables to the matrix variations generated above using `include`:
113143
include:
114-
- target: i686-unknown-linux-gnu
115-
os: ubuntu-latest
116-
- target: x86_64-unknown-linux-gnu
117-
os: ubuntu-latest
118-
- target: x86_64-unknown-linux-gnu-emulated
119-
os: ubuntu-latest
144+
- target:
145+
tuple: x86_64-unknown-linux-gnu-emulated
146+
os: ubuntu-latest
120147
test_everything: true
121148
rustflags: --cfg stdarch_intel_sde
122-
- target: arm-unknown-linux-gnueabihf
123-
os: ubuntu-latest
124-
- target: armv7-unknown-linux-gnueabihf
125-
os: ubuntu-latest
126149
# MIPS targets disabled since they are dropped to tier 3.
127150
# See https://github.com/rust-lang/compiler-team/issues/648
128-
#- target: mips-unknown-linux-gnu
129-
# os: ubuntu-latest
151+
#- target:
152+
# tuple: mips-unknown-linux-gnu
153+
# os: ubuntu-latest
130154
# norun: true
131-
#- target: mips64-unknown-linux-gnuabi64
132-
# os: ubuntu-latest
155+
#- target:
156+
# tuple: mips64-unknown-linux-gnuabi64
157+
# os: ubuntu-latest
133158
# norun: true
134-
#- target: mips64el-unknown-linux-gnuabi64
135-
# os: ubuntu-latest
159+
#- target:
160+
# tuple: mips64el-unknown-linux-gnuabi64
161+
# os: ubuntu-latest
136162
# norun: true
137-
#- target: mipsel-unknown-linux-musl
138-
# os: ubuntu-latest
139-
# norun: 1
140-
- target: powerpc64le-unknown-linux-gnu
141-
os: ubuntu-latest
163+
#- target:
164+
# tuple: mipsel-unknown-linux-musl
165+
# os: ubuntu-latest
166+
# norun: true
167+
- target:
168+
tuple: powerpc64le-unknown-linux-gnu
169+
os: ubuntu-latest
142170
disable_assert_instr: true
143-
- target: s390x-unknown-linux-gnu
144-
os: ubuntu-latest
145-
- target: wasm32-wasip1
146-
os: ubuntu-latest
147-
- target: aarch64-apple-darwin
148-
os: macos-latest
171+
- target:
172+
tuple: aarch64-apple-darwin
173+
os: macos-latest
149174
norun: true # https://github.com/rust-lang/stdarch/issues/1206
150-
- target: aarch64-apple-ios-macabi
151-
os: macos-latest
175+
- target:
176+
tuple: aarch64-apple-ios-macabi
177+
os: macos-latest
152178
norun: true # https://github.com/rust-lang/stdarch/issues/1206
153-
- target: aarch64-unknown-linux-gnu
154-
os: ubuntu-latest
155-
- target: x86_64-apple-darwin
156-
os: macos-13
157-
- target: x86_64-apple-ios-macabi
158-
os: macos-13
159-
- target: x86_64-pc-windows-msvc
160-
os: windows-latest
161-
- target: i686-pc-windows-msvc
162-
os: windows-latest
163-
- target: aarch64-pc-windows-msvc
164-
os: windows-latest
179+
- target:
180+
tuple: aarch64-pc-windows-msvc
181+
os: windows-latest
182+
norun: true
183+
- target:
184+
tuple: x86_64-pc-windows-msvc
185+
os: windows-latest
186+
profile: dev
165187
norun: true
166-
- target: x86_64-pc-windows-gnu
167-
os: windows-latest
168-
- target: i586-unknown-linux-gnu
169-
os: ubuntu-latest
170-
- target: nvptx64-nvidia-cuda
171-
os: ubuntu-latest
172-
- target: thumbv6m-none-eabi
173-
os: ubuntu-latest
174-
- target: thumbv7m-none-eabi
175-
os: ubuntu-latest
176-
- target: thumbv7em-none-eabi
177-
os: ubuntu-latest
178-
- target: thumbv7em-none-eabihf
179-
os: ubuntu-latest
180-
- target: riscv64gc-unknown-linux-gnu
181-
os: ubuntu-latest
182-
- target: loongarch64-unknown-linux-gnu
183-
os: ubuntu-latest
184188

185189
steps:
186190
- uses: actions/checkout@v4
@@ -191,15 +195,15 @@ jobs:
191195
rustup update nightly --no-self-update
192196
rustup default nightly
193197
- run: rustup target add ${{ matrix.target }}
194-
if: "!endsWith(matrix.target, 'emulated')"
198+
if: "!endsWith(matrix.target.tuple, 'emulated')"
195199
- run: cargo generate-lockfile
196200

197201
# Configure some env vars based on matrix configuration
198202
- run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
199203
shell: bash
200204
- run: echo "NORUN=1" >> $GITHUB_ENV
201205
shell: bash
202-
if: matrix.norun != '' || startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
206+
if: matrix.norun != '' || startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'
203207
- run: echo "STDARCH_TEST_EVERYTHING=1" >> $GITHUB_ENV
204208
shell: bash
205209
if: matrix.test_everything != ''
@@ -211,21 +215,21 @@ jobs:
211215
if: matrix.disable_assert_instr != ''
212216
- run: echo "NOSTD=1" >> $GITHUB_ENV
213217
shell: bash
214-
if: startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
218+
if: startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'
215219

216220
# Windows & OSX go straight to `run.sh` ...
217221
- run: ./ci/run.sh
218222
shell: bash
219-
if: matrix.os != 'ubuntu-latest' || startsWith(matrix.target, 'thumb')
223+
if: matrix.target.os != 'ubuntu-latest' || startsWith(matrix.target.tuple, 'thumb')
220224
env:
221-
TARGET: ${{ matrix.target }}
225+
TARGET: ${{ matrix.target.tuple }}
222226

223227
# ... while Linux goes to `run-docker.sh`
224-
- run: ./ci/run-docker.sh ${{ matrix.target }}
228+
- run: ./ci/run-docker.sh ${{ matrix.target.tuple }}
225229
shell: bash
226-
if: "matrix.os == 'ubuntu-latest' && !startsWith(matrix.target, 'thumb')"
230+
if: "matrix.target.os == 'ubuntu-latest' && !startsWith(matrix.target.tuple, 'thumb')"
227231
env:
228-
TARGET: ${{ matrix.target }}
232+
TARGET: ${{ matrix.target.tuple }}
229233

230234
build-std-detect:
231235
needs: [style]

0 commit comments

Comments
 (0)