@@ -22,24 +22,14 @@ jobs:
2222 rust : [stable]
2323 profile : [dev, release]
2424 steps :
25- - uses : actions/checkout@v3
26- - uses : actions-rs/ toolchain@v1
25+ - uses : actions/checkout@v4
26+ - uses : dtolnay/rust- toolchain@master
2727 with :
2828 toolchain : ${{ matrix.rust }}
29- profile : minimal
30- override : true
31- - if : ${{ matrix.profile == 'dev' }}
32- name : Build & test dev
33- run : |
34- cargo build
35- cargo build --all-features
36- cargo test
37- # We need to duplicate the logic here, because up to 1.56 Cargo
38- # considers the --profile option unstable. Once our minimum
39- # supported Rust version is above that, we should remove the above
40- # block.
41- - if : ${{ matrix.rust == 'stable' && matrix.profile != 'dev'}}
42- name : Build & test release
29+ - uses : Swatinem/rust-cache@v2
30+ with :
31+ key : ${{ matrix.profile }}
32+ - name : Build & test
4333 run : |
4434 cargo build --profile=${{ matrix.profile }}
4535 cargo build --all-features --profile=${{ matrix.profile }}
@@ -48,55 +38,43 @@ jobs:
4838 name : Build using minimum versions of dependencies
4939 runs-on : ubuntu-latest
5040 steps :
51- - uses : actions/checkout@v3
41+ - uses : actions/checkout@v4
5242 - name : Install Nightly Rust
53- uses : actions-rs/toolchain@v1
54- with :
55- profile : minimal
56- toolchain : nightly
43+ uses : dtolnay/rust-toolchain@nightly
5744 - run : cargo +nightly -Z minimal-versions update
5845 - name : Install minimum Rust
59- uses : actions-rs/ toolchain@v1
46+ uses : dtolnay/rust- toolchain@master
6047 with :
61- profile : minimal
6248 # Please adjust README and rust-version field in Cargo.toml files when
6349 # bumping version.
6450 toolchain : 1.56
65- default : true
6651 - uses : Swatinem/rust-cache@v2
6752 - name : Build
6853 run : cargo build --locked --all-features
6954 rustfmt :
7055 name : Check code formatting
7156 runs-on : ubuntu-latest
7257 steps :
73- - uses : actions/checkout@v3
74- - uses : actions-rs/ toolchain@v1
58+ - uses : actions/checkout@v4
59+ - uses : dtolnay/rust- toolchain@nightly
7560 with :
76- toolchain : nightly
7761 components : rustfmt
78- override : true
7962 - run : cargo +nightly fmt -- --check
8063 clippy :
8164 name : Lint with clippy
8265 runs-on : ubuntu-latest
8366 steps :
84- - uses : actions/checkout@v3
85- - uses : actions-rs/toolchain@v1
86- with :
87- toolchain : stable
88- components : clippy
89- override : true
67+ - uses : actions/checkout@v4
68+ - uses : dtolnay/rust-toolchain@stable
69+ - uses : Swatinem/rust-cache@v2
9070 - run : cargo clippy --no-deps --all-targets --all-features -- -A unknown_lints -D warnings
9171 rustdoc :
9272 name : Generate documentation
9373 runs-on : ubuntu-latest
9474 env :
9575 RUSTDOCFLAGS : ' -D warnings -D rustdoc::broken_intra_doc_links'
9676 steps :
97- - uses : actions/checkout@v3
98- - uses : actions-rs/toolchain@v1
99- with :
100- toolchain : stable
101- override : true
77+ - uses : actions/checkout@v4
78+ - uses : dtolnay/rust-toolchain@stable
79+ - uses : Swatinem/rust-cache@v2
10280 - run : cargo doc --no-deps
0 commit comments