77
88jobs :
99 install :
10- name : Rust ${{matrix.rust || '(toolchain file )'}} ${{matrix.os}}
10+ name : Rust ${{matrix.rust || '(default )'}} (toolchain-file= ${{matrix.write-toolchain-file}}) (${{matrix. os}})
1111 runs-on : ${{matrix.os}}
1212 strategy :
1313 fail-fast : false
1414 matrix :
15+ os :
16+ - ubuntu-latest
17+ - windows-latest
18+ - macos-latest
19+ write-toolchain-file :
20+ - false
21+ - true
1522 rust :
16- # Test with toolchain file override
23+ # use stable toolchain as default
1724 - null
1825
1926 # Test that the sparse registry check works.
@@ -23,21 +30,17 @@ jobs:
2330 - " nightly"
2431 - " beta"
2532 - " stable"
26- os :
27- - ubuntu-latest
28- - windows-latest
29- - macos-latest
3033 steps :
3134 - uses : actions/checkout@v4
3235
3336 # Test toolchain file support
3437 - name : Write rust-toolchain.toml
35- if : matrix.rust == null
38+ if : matrix.write-toolchain-file
3639 shell : bash
3740 run : |
3841 cat <<EOF >>rust-toolchain.toml
3942 [toolchain]
40- channel = "nightly-2024-01-11 "
43+ channel = "nightly-2024-01-10 "
4144 components = [ "rustfmt", "rustc-dev" ]
4245 targets = [ "wasm32-unknown-unknown", "thumbv7m-none-eabi" ]
4346 profile = "minimal"
5962 - name : Check ${{'${{steps.toolchain.outputs.rustup-version}}'}}
6063 run : echo '${{steps.toolchain.outputs.rustup-version}}'
6164
65+ - name : Check lack of toolchain input or file results in stable
66+ if : matrix.write-toolchain-file == false && matrix.rust == null
67+ shell : bash
68+ run : |-
69+ rustcv="$(rustc --version)"
70+ [[ "$rustcv" != *"nightly"* && "$rustcv" != *"beta"* ]]
71+
72+ - name : Check toolchain file is being overridden
73+ if : matrix.write-toolchain-file
74+ shell : bash
75+ run : |-
76+ rustcv="$(rustc --version)"
77+ [[ ! ( "$rustcv" == *"nightly"* && "$rustcv" == *"2024-01-10"* ) ]]
78+
6279 - shell : bash
6380 run : rustc --version && cargo --version
6481
0 commit comments