Skip to content

Commit 9ead943

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

File tree

1 file changed

+95
-92
lines changed

1 file changed

+95
-92
lines changed

.github/workflows/main.yml

Lines changed: 95 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -65,122 +65,125 @@ 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
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
8288
- riscv64gc-unknown-linux-gnu
83-
- powerpc64le-unknown-linux-gnu
89+
- tuple: powerpc64le-unknown-linux-gnu
90+
os: ubuntu-latest
8491
# MIPS targets disabled since they are dropped to tier 3.
8592
# See https://github.com/rust-lang/compiler-team/issues/648
8693
#- mips-unknown-linux-gnu
8794
#- mips64-unknown-linux-gnuabi64
8895
#- mips64el-unknown-linux-gnuabi64
8996
#- 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
97+
- tuple: s390x-unknown-linux-gnu
98+
os: ubuntu-latest
99+
- tuple: i586-unknown-linux-gnu
100+
os: ubuntu-latest
101+
- tuple: nvptx64-nvidia-cuda
102+
os: ubuntu-latest
103+
- tuple: thumbv6m-none-eabi
104+
os: ubuntu-latest
105+
- tuple: thumbv7m-none-eabi
106+
os: ubuntu-latest
107+
- tuple: thumbv7em-none-eabi
108+
os: ubuntu-latest
109+
- tuple: thumbv7em-none-eabihf
110+
os: ubuntu-latest
111+
- tuple: loongarch64-unknown-linux-gnu
112+
os: ubuntu-latest
113+
- tuple: wasm32-wasip1
114+
os: ubuntu-latest
99115

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

106129
# 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:
130+
- tuple: x86_64-pc-windows-msvc
131+
os: windows-latest
132+
- tuple: i686-pc-windows-msvc
133+
os: windows-latest
134+
- tuple: aarch64-pc-windows-msvc
135+
os: windows-latest
136+
- tuple: x86_64-pc-windows-gnu
137+
os: windows-latest
138+
# - tuple: i686-pc-windows-gnu
139+
# os: windows-latest
112140

141+
# Add additional variables to the matrix variations generated above using `include`:
113142
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
143+
- target:
144+
tuple: x86_64-unknown-linux-gnu-emulated
145+
os: ubuntu-latest
120146
test_everything: true
121147
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
126148
# MIPS targets disabled since they are dropped to tier 3.
127149
# See https://github.com/rust-lang/compiler-team/issues/648
128-
#- target: mips-unknown-linux-gnu
129-
# os: ubuntu-latest
150+
#- target:
151+
# tuple: mips-unknown-linux-gnu
152+
# os: ubuntu-latest
130153
# norun: true
131-
#- target: mips64-unknown-linux-gnuabi64
132-
# os: ubuntu-latest
154+
#- target:
155+
# tuple: mips64-unknown-linux-gnuabi64
156+
# os: ubuntu-latest
133157
# norun: true
134-
#- target: mips64el-unknown-linux-gnuabi64
135-
# os: ubuntu-latest
158+
#- target:
159+
# tuple: mips64el-unknown-linux-gnuabi64
160+
# os: ubuntu-latest
136161
# 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
162+
#- target:
163+
# tuple: mipsel-unknown-linux-musl
164+
# os: ubuntu-latest
165+
# norun: true
166+
- target:
167+
tuple: powerpc64le-unknown-linux-gnu
168+
os: ubuntu-latest
142169
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
170+
- target:
171+
tuple: aarch64-apple-darwin
172+
os: macos-latest
149173
norun: true # https://github.com/rust-lang/stdarch/issues/1206
150-
- target: aarch64-apple-ios-macabi
151-
os: macos-latest
174+
- target:
175+
tuple: aarch64-apple-ios-macabi
176+
os: macos-latest
152177
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
178+
- target:
179+
tuple: aarch64-pc-windows-msvc
180+
os: windows-latest
181+
norun: true
182+
- target:
183+
tuple: x86_64-pc-windows-msvc
184+
os: windows-latest
185+
profile: dev
165186
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
184187

185188
steps:
186189
- uses: actions/checkout@v4
@@ -191,15 +194,15 @@ jobs:
191194
rustup update nightly --no-self-update
192195
rustup default nightly
193196
- run: rustup target add ${{ matrix.target }}
194-
if: "!endsWith(matrix.target, 'emulated')"
197+
if: "!endsWith(matrix.target.tuple, 'emulated')"
195198
- run: cargo generate-lockfile
196199

197200
# Configure some env vars based on matrix configuration
198201
- run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
199202
shell: bash
200203
- run: echo "NORUN=1" >> $GITHUB_ENV
201204
shell: bash
202-
if: matrix.norun != '' || startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
205+
if: matrix.norun != '' || startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'
203206
- run: echo "STDARCH_TEST_EVERYTHING=1" >> $GITHUB_ENV
204207
shell: bash
205208
if: matrix.test_everything != ''
@@ -211,21 +214,21 @@ jobs:
211214
if: matrix.disable_assert_instr != ''
212215
- run: echo "NOSTD=1" >> $GITHUB_ENV
213216
shell: bash
214-
if: startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
217+
if: startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'
215218

216219
# Windows & OSX go straight to `run.sh` ...
217220
- run: ./ci/run.sh
218221
shell: bash
219-
if: matrix.os != 'ubuntu-latest' || startsWith(matrix.target, 'thumb')
222+
if: matrix.target.os != 'ubuntu-latest' || startsWith(matrix.target.tuple, 'thumb')
220223
env:
221-
TARGET: ${{ matrix.target }}
224+
TARGET: ${{ matrix.target.tuple }}
222225

223226
# ... while Linux goes to `run-docker.sh`
224-
- run: ./ci/run-docker.sh ${{ matrix.target }}
227+
- run: ./ci/run-docker.sh ${{ matrix.target.tuple }}
225228
shell: bash
226-
if: "matrix.os == 'ubuntu-latest' && !startsWith(matrix.target, 'thumb')"
229+
if: "matrix.target.os == 'ubuntu-latest' && !startsWith(matrix.target.tuple, 'thumb')"
227230
env:
228-
TARGET: ${{ matrix.target }}
231+
TARGET: ${{ matrix.target.tuple }}
229232

230233
build-std-detect:
231234
needs: [style]

0 commit comments

Comments
 (0)