Skip to content

Commit 58265b9

Browse files
committed
ci: use env rather than passing environment inline
1 parent 4707c5d commit 58265b9

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
@@ -27,8 +27,6 @@ jobs:
2727
build_channels_linux:
2828
name: Build Channels Linux
2929
runs-on: ubuntu-22.04
30-
env:
31-
OS: linux
3230
strategy:
3331
fail-fast: true
3432
max-parallel: 5
@@ -38,18 +36,19 @@ jobs:
3836
- beta
3937
- nightly
4038
- 1.63.0
39+
env:
40+
OS: linux
41+
TOOLCHAIN: ${{ matrix.toolchain }}
4142
steps:
4243
- uses: actions/checkout@v4
4344
- name: Setup Rust toolchain
44-
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/install-rust.sh
45+
run: ./ci/install-rust.sh
4546
- name: Execute build.sh
46-
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
47+
run: ./ci/build.sh
4748

4849
build_channels_macos:
4950
name: Build Channels macOS
5051
needs: macos
51-
env:
52-
OS: macos
5352
strategy:
5453
fail-fast: true
5554
max-parallel: 4
@@ -60,31 +59,35 @@ jobs:
6059
- { toolchain: nightly, os: macos-14 }
6160
- { toolchain: 1.63.0, os: macos-14 }
6261
runs-on: ${{ matrix.target.os }}
62+
env:
63+
OS: macos
64+
TOOLCHAIN: ${{ matrix.toolchain }}
6365
steps:
6466
- uses: actions/checkout@v4
6567
- name: Setup Rust toolchain
66-
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/install-rust.sh
68+
run: ./ci/install-rust.sh
6769
- name: Execute build.sh
68-
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/build.sh
70+
run: ./ci/build.sh
6971

7072
build_channels_windows:
7173
name: Build Channels Windows
7274
runs-on: windows-2022
73-
env:
74-
OS: windows
7575
strategy:
7676
fail-fast: true
7777
matrix:
7878
toolchain:
7979
- 1.63.0
8080
- stable
81+
env:
82+
OS: windows
83+
TOOLCHAIN: ${{ matrix.toolchain }}
8184
steps:
8285
- uses: actions/checkout@v4
8386
- name: Self-update rustup
8487
run: rustup self update
8588
shell: bash
8689
- name: Execute build.sh
87-
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
90+
run: ./ci/build.sh
8891
shell: bash
8992

9093
macos:
@@ -95,18 +98,18 @@ jobs:
9598
matrix:
9699
target:
97100
- aarch64-apple-darwin
101+
env:
102+
TARGET: ${{ matrix.target }}
98103
steps:
99104
- uses: actions/checkout@v4
100105
- name: Setup Rust toolchain
101-
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
106+
run: ./ci/install-rust.sh
102107
- name: Execute run.sh
103108
run: ./ci/run.sh ${{ matrix.target }}
104109

105110
windows:
106111
name: Windows
107112
runs-on: windows-2022
108-
env:
109-
OS: windows
110113
strategy:
111114
fail-fast: true
112115
matrix:
@@ -122,13 +125,16 @@ jobs:
122125
# ARCH_BITS: 32
123126
# ARCH: i686
124127
- target: i686-pc-windows-msvc
128+
env:
129+
OS: windows
130+
TARGET: ${{ matrix.target }}
125131
steps:
126132
- uses: actions/checkout@v4
127133
- name: Self-update rustup
128134
run: rustup self update
129135
shell: bash
130136
- name: Setup Rust toolchain
131-
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
137+
run: ./ci/install-rust.sh
132138
shell: bash
133139
- name: Execute run.sh
134140
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)