@@ -20,30 +20,13 @@ jobs:
2020 os : [ubuntu-latest, windows-latest, macos-latest]
2121 steps :
2222 - uses : actions/checkout@v4
23- - name : Cache Rust dependencies
24- uses : actions/cache@v3
23+ - name : Set up cargo cache
24+ uses : Swatinem/rust-cache@v2
25+ if : github.ref != 'refs/heads/main'
2526 with :
26- path : |
27- ~/.cargo
28- target
29- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
30- restore-keys : |
31- ${{ runner.os }}-cargo-
32- - name : Set up Rust toolchain version
33- run : |
34- if [ ! -f rust-toolchain.toml ]; then
35- echo "Error: rust-toolchain.toml file not found!" >&2
36- exit 1
37- fi
38- TOOLCHAIN_VERSION=$(grep 'channel' rust-toolchain.toml | cut -d '"' -f2)
39- echo "TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> $GITHUB_ENV
40- - name : Install Rust toolchain
41- run : |
42- rustup set profile minimal
43- rustup install "$TOOLCHAIN_VERSION"
44- rustup default "$TOOLCHAIN_VERSION"
45- rustup component add rustfmt clippy llvm-tools-preview rustc-dev
46- rustup show
27+ prefix-key : " andromeda-${{ runner.os }}"
28+ - name : Install the rust toolchain
29+ uses : dtolnay/rust-toolchain@stable
4730 - name : Test
4831 run : cargo test
4932 timeout-minutes : 20
5437 - name : Clippy
5538 run : |
5639 cargo clippy --all-targets -- -D warnings
57- cargo +$TOOLCHAIN_VERSION clippy --all-targets --all-features -- -D warnings
40+ cargo clippy --all-targets --all-features -- -D warnings
0 commit comments