@@ -14,10 +14,6 @@ permissions:
1414
1515env :
1616 MSRV : 1.69.0
17- # Rust's Loongarch support merged in 1.71.0
18- MSRV_LOONGARCH : 1.71.0
19- # Minimal Rust version to support all 3 official OpenHarmony targets as tier2
20- MSRV_OHOS : 1.78.0
2117 RUSTFLAGS : -Dwarnings
2218
2319jobs :
3228 - name : setup Rust
3329 uses : dtolnay/rust-toolchain@master
3430 with :
35- toolchain : ' ${{ env.MSRV }} '
31+ toolchain : stable
3632 components : clippy
3733
3834 - name : build
5955 - name : setup Rust
6056 uses : dtolnay/rust-toolchain@master
6157 with :
62- toolchain : ' ${{ env.MSRV }} '
58+ toolchain : stable
6359 components : clippy
6460
6561 - name : build
7975 # cross needs to execute Docker, GitHub Action already has it installed
8076 cross :
8177 runs-on : ubuntu-24.04
82- needs : [rustfmt, minver, macos, x86_64_linux_native_builds, rust_stable ]
78+ needs : [rustfmt, minver, macos, x86_64_linux_native_builds]
8379 strategy :
8480 fail-fast : false
8581 matrix :
@@ -108,8 +104,7 @@ jobs:
108104 - name : setup Rust
109105 uses : dtolnay/rust-toolchain@master
110106 with :
111- # Use a newer version rustc if the target is Loongarch, remove this workaround after MSRV is newer than 1.71.0
112- toolchain : " ${{ matrix.target == 'loongarch64-unknown-linux-gnu' && env.MSRV_LOONGARCH || env.MSRV }}"
107+ toolchain : stable
113108 components : clippy
114109
115110 # cross relies on docker or podman, GitHub Acton already has it installed.
@@ -156,7 +151,7 @@ jobs:
156151 - name : setup Rust
157152 uses : dtolnay/rust-toolchain@master
158153 with :
159- toolchain : ' ${{ env.MSRV }} '
154+ toolchain : stable
160155 components : clippy
161156
162157 - name : install targets
@@ -193,7 +188,7 @@ jobs:
193188 - name : setup Rust
194189 uses : dtolnay/rust-toolchain@master
195190 with :
196- toolchain : ' ${{ env.MSRV }} '
191+ toolchain : stable
197192 components : clippy
198193
199194 - name : install targets
@@ -212,38 +207,11 @@ jobs:
212207 - name : before_cache_script
213208 run : sudo rm -rf $CARGO_HOME/registry/index;
214209
215- rust_stable :
216- runs-on : ubuntu-latest
217- env :
218- TARGET : x86_64-unknown-linux-gnu
219- steps :
220- - name : checkout
221- uses : actions/checkout@v4
222-
223- - name : setup Rust
224- uses : dtolnay/rust-toolchain@stable
225- with :
226- components : clippy
227-
228- - name : build
229- uses : ./.github/actions/build
230- with :
231- TARGET : ' ${{ env.TARGET }}'
232-
233- - name : test
234- uses : ./.github/actions/test
235- with :
236- TARGET : ' ${{ env.TARGET }}'
237-
238- - name : before_cache_script
239- run : sudo rm -rf $CARGO_HOME/registry/index
240-
241-
242210
243211 # Tasks for cross-compiling, but no testing
244212 cross_compiling :
245213 runs-on : ubuntu-latest
246- needs : [rustfmt, minver, macos, x86_64_linux_native_builds, rust_stable ]
214+ needs : [rustfmt, minver, macos, x86_64_linux_native_builds]
247215 env :
248216 BUILD : check
249217 strategy :
@@ -282,8 +250,7 @@ jobs:
282250 - name : setup Rust
283251 uses : dtolnay/rust-toolchain@master
284252 with :
285- # Use a newer version rustc if it is OpenHarmony, remove this workaround after MSRV is newer than 1.78.0
286- toolchain : " ${{ contains(matrix.target, 'ohos') && env.MSRV_OHOS || env.MSRV }}"
253+ toolchain : stable
287254 components : clippy
288255
289256 - name : install targets
@@ -299,10 +266,54 @@ jobs:
299266 - name : before_cache_script
300267 run : rm -rf $CARGO_HOME/registry/index
301268
269+ # Check that Nix will build on the MSRV, on a variety of operating systems.
270+ # But don't check the tests. Those are not required to build on MSRV.
271+ msrv :
272+ runs-on : ubuntu-latest
273+ needs : [rustfmt, minver, macos, x86_64_linux_native_builds]
274+ env :
275+ BUILD : check
276+ NOCLIPPY : true
277+ NODOC : true
278+ NOHACK : true
279+ strategy :
280+ fail-fast : false
281+ matrix :
282+ include :
283+ - target : aarch64-linux-android
284+ - target : x86_64-unknown-linux-gnu
285+ - target : x86_64-unknown-linux-musl
286+ - target : aarch64-apple-darwin
287+ - target : x86_64-unknown-freebsd
288+ - target : x86_64-unknown-netbsd
289+ steps :
290+ - name : checkout
291+ uses : actions/checkout@v4
292+
293+ - name : setup Rust
294+ uses : dtolnay/rust-toolchain@master
295+ with :
296+ toolchain : $MSRV
297+
298+ - name : install targets
299+ run : rustup target add ${{ matrix.target }}
300+
301+ - name : build
302+ uses : ./.github/actions/build
303+ with :
304+ TARGET : ' ${{ matrix.target }}'
305+ BUILD : ' ${{ env.BUILD }}'
306+ NOCLIPPY : ' ${{ matrix.NOCLIPPY }}'
307+ NODOC : ' ${{ matrix.NODOC }}'
308+ NOHACK : ' ${{ matrix.NOHACK }}'
309+
310+ - name : before_cache_script
311+ run : rm -rf $CARGO_HOME/registry/index
312+
302313
303314 redox :
304315 runs-on : ubuntu-latest
305- needs : [rustfmt, minver, macos, x86_64_linux_native_builds, rust_stable ]
316+ needs : [rustfmt, minver, macos, x86_64_linux_native_builds]
306317 env :
307318 TARGET : x86_64-unknown-redox
308319 CLIPPYFLAGS : -D warnings
0 commit comments