@@ -82,32 +82,37 @@ jobs:
82
82
os : [ubuntu-latest, windows-latest, macOS-latest]
83
83
steps :
84
84
- uses : actions/checkout@v4
85
- # on non-msrv runs, just download rust
86
85
- uses : dtolnay/rust-toolchain@master
87
86
with :
88
87
toolchain : ${{matrix.rust.toolchain}}
89
88
id : rust-toolchain
90
- if : matrix.rust.name != 'MSRV'
91
89
# on msrv runs, use stable to generate Cargo.lock then downgrade
92
- - uses : dtolnay/rust-toolchain@stable
93
- if : matrix.rust.name == 'MSRV'
94
90
- run : cargo --config 'resolver.incompatible-rust-versions="fallback"' update
95
91
- run : echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT
96
92
id : msrv
97
93
if : matrix.rust.name == 'MSRV'
98
94
- uses : dtolnay/rust-toolchain@master
99
95
with :
100
96
toolchain : ${{steps.msrv.outputs.rust-version}}
101
- id : rust -toolchain
97
+ id : msrv -toolchain
102
98
if : matrix.rust.name == 'MSRV'
103
- # the rest is independent of whether msrv is used
99
+ # on non-msrv runs, use one cache key ...
104
100
- uses : actions/cache@v4
105
101
with :
106
102
path : |
107
103
~/.cargo/git
108
104
~/.cargo/registry
109
105
target
110
106
key : " ${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
107
+ # ... and on msrv runs, use another
108
+ - uses : actions/cache@v4
109
+ with :
110
+ path : |
111
+ ~/.cargo/git
112
+ ~/.cargo/registry
113
+ target
114
+ key : " ${{runner.os}} Rust ${{steps.msrv-toolchain.outputs.cachekey}}"
115
+ # finally we can run tests
111
116
- run : cargo test --lib --locked
112
117
- run : cargo test --doc --locked
113
118
0 commit comments