Skip to content

Commit 2aeccfa

Browse files
committed
github actions is stupid
1 parent b4091c4 commit 2aeccfa

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/rust.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -82,32 +82,37 @@ jobs:
8282
os: [ubuntu-latest, windows-latest, macOS-latest]
8383
steps:
8484
- uses: actions/checkout@v4
85-
# on non-msrv runs, just download rust
8685
- uses: dtolnay/rust-toolchain@master
8786
with:
8887
toolchain: ${{matrix.rust.toolchain}}
8988
id: rust-toolchain
90-
if: matrix.rust.name != 'MSRV'
9189
# on msrv runs, use stable to generate Cargo.lock then downgrade
92-
- uses: dtolnay/rust-toolchain@stable
93-
if: matrix.rust.name == 'MSRV'
9490
- run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update
9591
- run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT
9692
id: msrv
9793
if: matrix.rust.name == 'MSRV'
9894
- uses: dtolnay/rust-toolchain@master
9995
with:
10096
toolchain: ${{steps.msrv.outputs.rust-version}}
101-
id: rust-toolchain
97+
id: msrv-toolchain
10298
if: matrix.rust.name == 'MSRV'
103-
# the rest is independent of whether msrv is used
99+
# on non-msrv runs, use one cache key ...
104100
- uses: actions/cache@v4
105101
with:
106102
path: |
107103
~/.cargo/git
108104
~/.cargo/registry
109105
target
110106
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
111116
- run: cargo test --lib --locked
112117
- run: cargo test --doc --locked
113118

0 commit comments

Comments
 (0)