Skip to content

Commit 73eae6b

Browse files
committed
ci: resolve target tuple from rustc
1 parent 30024f8 commit 73eae6b

File tree

1 file changed

+18
-35
lines changed

1 file changed

+18
-35
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ jobs:
1717
name: Test
1818
strategy:
1919
matrix:
20-
include:
21-
- os: ubuntu-24.04
22-
target: x86_64-unknown-linux-gnu
23-
- os: windows-2022
24-
target: x86_64-pc-windows-msvc
25-
- os: macOS-latest
26-
target: aarch64-apple-darwin
20+
os: [ ubuntu-24.04 windows-2022 macOS-latest ]
2721
runs-on: ${{ matrix.os }}
2822
env:
2923
RUSTUP_UNPACK_RAM: "26214400"
@@ -38,13 +32,16 @@ jobs:
3832
- if: ${{ runner.os == 'Linux' }}
3933
name: Linux - Install native dependencies
4034
run: sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
41-
# cargo version is a random command that forces the installation of rust-toolchain
35+
# just need a random command that forces the installation of rust-toolchain
36+
# figure out native target triple while we're at it
4237
- name: install rust-toolchain
43-
run: cargo version
38+
run: |
39+
export TARGET=`rustc --print host-tuple`
40+
echo $TARGET
4441
# Fetch dependencies in a separate step to clearly show how long each part
4542
# of the testing takes
4643
- name: cargo fetch --locked
47-
run: cargo fetch --locked --target ${{ matrix.target }}
44+
run: cargo fetch --locked --target $TARGET
4845

4946
# Core crates
5047
# Compiled in --release because cargo compiletest would otherwise compile in release again.
@@ -83,7 +80,6 @@ jobs:
8380
include:
8481
- os: ubuntu-24.04
8582
target: aarch64-linux-android
86-
host: x86_64-unknown-linux-gnu
8783
runs-on: ${{ matrix.os }}
8884
env:
8985
RUSTUP_UNPACK_RAM: "26214400"
@@ -95,11 +91,8 @@ jobs:
9591
with:
9692
version: 1.4.309.0
9793
cache: true
98-
# cargo version is a random command that forces the installation of rust-toolchain
9994
- name: install rust-toolchain
10095
run: cargo version
101-
# Fetch dependencies in a separate step to clearly show how long each part
102-
# of the testing takes
10396
- name: cargo fetch --locked
10497
run: cargo fetch --locked --target ${{ matrix.target }}
10598

@@ -130,13 +123,7 @@ jobs:
130123
name: Compiletest
131124
strategy:
132125
matrix:
133-
include:
134-
- os: ubuntu-24.04
135-
target: x86_64-unknown-linux-gnu
136-
- os: windows-2022
137-
target: x86_64-pc-windows-msvc
138-
- os: macOS-latest
139-
target: aarch64-apple-darwin
126+
os: [ ubuntu-24.04 windows-2022 macOS-latest ]
140127
runs-on: ${{ matrix.os }}
141128
steps:
142129
- uses: actions/checkout@v4
@@ -145,25 +132,20 @@ jobs:
145132
with:
146133
version: 1.4.309.0
147134
cache: true
148-
# cargo version is a random command that forces the installation of rust-toolchain
149135
- name: install rust-toolchain
150-
run: cargo version
136+
run: |
137+
export TARGET=`rustc --print host-tuple`
138+
echo $TARGET
151139
- name: cargo fetch --locked
152-
run: cargo fetch --locked --target ${{ matrix.target }}
140+
run: cargo fetch --locked --target $TARGET
153141
- name: compiletest
154142
run: cargo run -p compiletests --release --no-default-features --features "use-installed-tools" -- --target-env vulkan1.1,vulkan1.2,spv1.3
155143

156144
difftest:
157145
name: Difftest
158146
strategy:
159147
matrix:
160-
include:
161-
- os: ubuntu-24.04
162-
target: x86_64-unknown-linux-gnu
163-
- os: windows-2022
164-
target: x86_64-pc-windows-msvc
165-
- os: macOS-latest
166-
target: aarch64-apple-darwin
148+
os: [ ubuntu-24.04 windows-2022 macOS-latest ]
167149
runs-on: ${{ matrix.os }}
168150
steps:
169151
- uses: actions/checkout@v4
@@ -182,13 +164,14 @@ jobs:
182164
sudo add-apt-repository ppa:kisak/turtle -y
183165
sudo apt-get update
184166
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
185-
# cargo version is a random command that forces the installation of rust-toolchain
186167
- name: install rust-toolchain
187-
run: cargo version
168+
run: |
169+
export TARGET=`rustc --print host-tuple`
170+
echo $TARGET
188171
- name: cargo fetch --locked
189-
run: cargo fetch --locked --target ${{ matrix.target }}
172+
run: cargo fetch --locked --target $TARGET
190173
- name: cargo fetch --locked difftests
191-
run: cargo fetch --locked --manifest-path=tests/difftests/tests/Cargo.toml --target ${{ matrix.target }}
174+
run: cargo fetch --locked --manifest-path=tests/difftests/tests/Cargo.toml --target $TARGET
192175
- name: test difftest
193176
run: cargo test -p "difftest*" --release --no-default-features --features "use-installed-tools"
194177
- name: difftests

0 commit comments

Comments
 (0)