Skip to content

Commit 129909d

Browse files
committed
ci: use env rather than passing environment inline
(backport <#4124>) (cherry picked from commit 58265b9)
1 parent 3e48e4b commit 129909d

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
build_channels_linux:
2929
name: Build Channels Linux
3030
runs-on: ubuntu-22.04
31-
env:
32-
OS: linux
3331
strategy:
3432
fail-fast: true
3533
max-parallel: 5
@@ -39,18 +37,19 @@ jobs:
3937
- beta
4038
- nightly
4139
- 1.63.0
40+
env:
41+
OS: linux
42+
TOOLCHAIN: ${{ matrix.toolchain }}
4243
steps:
4344
- uses: actions/checkout@v4
4445
- name: Setup Rust toolchain
45-
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/install-rust.sh
46+
run: ./ci/install-rust.sh
4647
- name: Execute build.sh
47-
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
48+
run: ./ci/build.sh
4849

4950
build_channels_macos:
5051
name: Build Channels macOS
5152
needs: macos
52-
env:
53-
OS: macos
5453
strategy:
5554
fail-fast: true
5655
max-parallel: 4
@@ -61,31 +60,35 @@ jobs:
6160
- { toolchain: nightly, os: macos-14 }
6261
- { toolchain: 1.63.0, os: macos-14 }
6362
runs-on: ${{ matrix.target.os }}
63+
env:
64+
OS: macos
65+
TOOLCHAIN: ${{ matrix.toolchain }}
6466
steps:
6567
- uses: actions/checkout@v4
6668
- name: Setup Rust toolchain
67-
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/install-rust.sh
69+
run: ./ci/install-rust.sh
6870
- name: Execute build.sh
69-
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/build.sh
71+
run: ./ci/build.sh
7072

7173
build_channels_windows:
7274
name: Build Channels Windows
7375
runs-on: windows-2022
74-
env:
75-
OS: windows
7676
strategy:
7777
fail-fast: true
7878
matrix:
7979
toolchain:
8080
- 1.63.0
8181
- stable
82+
env:
83+
OS: windows
84+
TOOLCHAIN: ${{ matrix.toolchain }}
8285
steps:
8386
- uses: actions/checkout@v4
8487
- name: Self-update rustup
8588
run: rustup self update
8689
shell: bash
8790
- name: Execute build.sh
88-
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
91+
run: ./ci/build.sh
8992
shell: bash
9093

9194
macos:
@@ -96,18 +99,18 @@ jobs:
9699
matrix:
97100
target:
98101
- aarch64-apple-darwin
102+
env:
103+
TARGET: ${{ matrix.target }}
99104
steps:
100105
- uses: actions/checkout@v4
101106
- name: Setup Rust toolchain
102-
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
107+
run: ./ci/install-rust.sh
103108
- name: Execute run.sh
104109
run: ./ci/run.sh ${{ matrix.target }}
105110

106111
windows:
107112
name: Windows
108113
runs-on: windows-2022
109-
env:
110-
OS: windows
111114
strategy:
112115
fail-fast: true
113116
matrix:
@@ -123,13 +126,16 @@ jobs:
123126
# ARCH_BITS: 32
124127
# ARCH: i686
125128
- target: i686-pc-windows-msvc
129+
env:
130+
OS: windows
131+
TARGET: ${{ matrix.target }}
126132
steps:
127133
- uses: actions/checkout@v4
128134
- name: Self-update rustup
129135
run: rustup self update
130136
shell: bash
131137
- name: Setup Rust toolchain
132-
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
138+
run: ./ci/install-rust.sh
133139
shell: bash
134140
- name: Execute run.sh
135141
run: ./ci/run.sh ${{ matrix.target }}
@@ -144,10 +150,12 @@ jobs:
144150
target:
145151
- i686-unknown-linux-gnu
146152
- x86_64-unknown-linux-gnu
153+
env:
154+
TARGET: ${{ matrix.target }}
147155
steps:
148156
- uses: actions/checkout@v4
149157
- name: Setup Rust toolchain
150-
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
158+
run: ./ci/install-rust.sh
151159
- name: Execute run-docker.sh
152160
run: ./ci/run-docker.sh ${{ matrix.target }}
153161

@@ -186,10 +194,12 @@ jobs:
186194
# FIXME: It seems some items in `src/unix/mod.rs`
187195
# aren't defined on redox actually.
188196
# - x86_64-unknown-redox
197+
env:
198+
TARGET: ${{ matrix.target }}
189199
steps:
190200
- uses: actions/checkout@v4
191201
- name: Setup Rust toolchain
192-
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
202+
run: ./ci/install-rust.sh
193203
- name: Execute run-docker.sh
194204
run: ./ci/run-docker.sh ${{ matrix.target }}
195205

@@ -223,10 +233,12 @@ jobs:
223233
check_cfg:
224234
name: "Check #[cfg]s"
225235
runs-on: ubuntu-22.04
236+
env:
237+
TOOLCHAIN: nightly
226238
steps:
227239
- uses: actions/checkout@v4
228240
- name: Setup Rust toolchain
229-
run: TOOLCHAIN=nightly ./ci/install-rust.sh
241+
run: ./ci/install-rust.sh
230242
- name: Build with check-cfg
231243
run: LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg
232244

0 commit comments

Comments
 (0)