7
7
8
8
jobs :
9
9
install :
10
- name : Rust ${{matrix.rust || '(toolchain file )'}} ${{matrix.os}}
10
+ name : Rust ${{matrix.rust || '(default )'}} (toolchain-file= ${{matrix.write-toolchain-file}}) (${{matrix. os}})
11
11
runs-on : ${{matrix.os}}
12
12
strategy :
13
13
fail-fast : false
14
14
matrix :
15
+ os :
16
+ - ubuntu-latest
17
+ - windows-latest
18
+ - macos-latest
19
+ write-toolchain-file :
20
+ - false
21
+ - true
15
22
rust :
16
- # Test with toolchain file override
23
+ # use stable toolchain as default
17
24
- null
18
25
19
26
# Test that the sparse registry check works.
@@ -23,21 +30,17 @@ jobs:
23
30
- " nightly"
24
31
- " beta"
25
32
- " stable"
26
- os :
27
- - ubuntu-latest
28
- - windows-latest
29
- - macos-latest
30
33
steps :
31
34
- uses : actions/checkout@v4
32
35
33
36
# Test toolchain file support
34
37
- name : Write rust-toolchain.toml
35
- if : matrix.rust == null
38
+ if : matrix.write-toolchain-file
36
39
shell : bash
37
40
run : |
38
41
cat <<EOF >>rust-toolchain.toml
39
42
[toolchain]
40
- channel = "nightly-2024-01-11 "
43
+ channel = "nightly-2024-01-10 "
41
44
components = [ "rustfmt", "rustc-dev" ]
42
45
targets = [ "wasm32-unknown-unknown", "thumbv7m-none-eabi" ]
43
46
profile = "minimal"
59
62
- name : Check ${{'${{steps.toolchain.outputs.rustup-version}}'}}
60
63
run : echo '${{steps.toolchain.outputs.rustup-version}}'
61
64
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
+
62
79
- shell : bash
63
80
run : rustc --version && cargo --version
64
81
0 commit comments