@@ -20,30 +20,13 @@ jobs:
20
20
os : [ubuntu-latest, windows-latest, macos-latest]
21
21
steps :
22
22
- 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'
25
26
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
47
30
- name : Test
48
31
run : cargo test
49
32
timeout-minutes : 20
54
37
- name : Clippy
55
38
run : |
56
39
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