@@ -13,87 +13,34 @@ permissions:
1313 contents : read
1414
1515env :
16- CARGO_INCREMENTAL : 0
1716 RUSTFLAGS : " -Dwarnings"
18- CARGO_HOME : ${{ github.workspace }}/.cargo
19- CARGO_TARGET_DIR : ${{ github.workspace }}/target
2017
2118jobs :
2219 clippy :
2320 runs-on : ubuntu-latest
2421 steps :
2522 - uses : actions/checkout@v4
26- - name : Cache Rust toolchain
27- uses : actions/cache@v4
28- with :
29- path : |
30- ~/.rustup/toolchains
31- ~/.rustup/downloads
32- key : rust-toolchain-${{ runner.os }}-1.88.0-clippy
33- restore-keys : |
34- rust-toolchain-${{ runner.os }}-1.88.0
3523 - uses : dtolnay/rust-toolchain@master
3624 with :
3725 toolchain : 1.88.0
3826 components : clippy
39- - name : Cache Cargo registry and index
40- uses : actions/cache@v4
41- with :
42- path : |
43- ~/.cargo/registry
44- ~/.cargo/git
45- key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
46- restore-keys : |
47- cargo-${{ runner.os }}-
27+ - uses : Swatinem/rust-cache@v2
4828 - run : cargo clippy --all --all-features -- -D warnings
4929
5030 doc :
5131 runs-on : ubuntu-latest
5232 steps :
5333 - uses : actions/checkout@v4
54- - name : Cache Rust toolchain
55- uses : actions/cache@v4
56- with :
57- path : |
58- ~/.rustup/toolchains
59- ~/.rustup/downloads
60- key : rust-toolchain-${{ runner.os }}-stable-doc
61- restore-keys : |
62- rust-toolchain-${{ runner.os }}-stable
6334 - uses : dtolnay/rust-toolchain@master
6435 with :
6536 toolchain : stable
66- - name : Cache Cargo registry and index
67- uses : actions/cache@v4
68- with :
69- path : |
70- ~/.cargo/registry
71- ~/.cargo/git
72- key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
73- restore-keys : |
74- cargo-${{ runner.os }}-
75- - name : Cache target directory
76- uses : actions/cache@v4
77- with :
78- path : target
79- key : cargo-doc-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
80- restore-keys : |
81- cargo-doc-${{ runner.os }}-
37+ - uses : Swatinem/rust-cache@v2
8238 - run : cargo doc --all-features --no-deps
8339
8440 rustfmt :
8541 runs-on : ubuntu-latest
8642 steps :
8743 - uses : actions/checkout@v4
88- - name : Cache Rust toolchain
89- uses : actions/cache@v4
90- with :
91- path : |
92- ~/.rustup/toolchains
93- ~/.rustup/downloads
94- key : rust-toolchain-${{ runner.os }}-stable-rustfmt
95- restore-keys : |
96- rust-toolchain-${{ runner.os }}-stable
9744 - uses : dtolnay/rust-toolchain@master
9845 with :
9946 toolchain : stable
@@ -123,35 +70,13 @@ jobs:
12370 target : riscv32imac-unknown-none-elf
12471 steps :
12572 - uses : actions/checkout@v4
126- - name : Cache Rust toolchain
127- uses : actions/cache@v4
128- with :
129- path : |
130- ~/.rustup/toolchains
131- ~/.rustup/downloads
132- key : rust-toolchain-${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}
133- restore-keys : |
134- rust-toolchain-${{ runner.os }}-${{ matrix.rust }}
13573 - uses : dtolnay/rust-toolchain@master
13674 with :
13775 toolchain : ${{ matrix.rust }}
13876 targets : ${{ matrix.target }}
139- - name : Cache Cargo registry and index
140- uses : actions/cache@v4
141- with :
142- path : |
143- ~/.cargo/registry
144- ~/.cargo/git
145- key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
146- restore-keys : |
147- cargo-${{ runner.os }}-
148- - name : Cache target directory
149- uses : actions/cache@v4
77+ - uses : Swatinem/rust-cache@v2
15078 with :
151- path : target
152- key : cargo-nostd-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
153- restore-keys : |
154- cargo-nostd-${{ runner.os }}-${{ matrix.target }}-
79+ key : ${{ matrix.target }}
15580 - run : cargo build --no-default-features --features tls12,full,alloc --release --target ${{ matrix.target }}
15681 env :
15782 RUSTFLAGS : --cfg getrandom_backend="custom"
@@ -164,34 +89,12 @@ jobs:
16489 runs-on : ubuntu-latest
16590 steps :
16691 - uses : actions/checkout@v4
167- - name : Cache Rust toolchain
168- uses : actions/cache@v4
169- with :
170- path : |
171- ~/.rustup/toolchains
172- ~/.rustup/downloads
173- key : rust-toolchain-${{ runner.os }}-${{ matrix.toolchain }}-test
174- restore-keys : |
175- rust-toolchain-${{ runner.os }}-${{ matrix.toolchain }}
17692 - uses : dtolnay/rust-toolchain@master
17793 with :
17894 toolchain : ${{ matrix.toolchain }}
179- - name : Cache Cargo registry and index
180- uses : actions/cache@v4
181- with :
182- path : |
183- ~/.cargo/registry
184- ~/.cargo/git
185- key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
186- restore-keys : |
187- cargo-${{ runner.os }}-
188- - name : Cache target directory
189- uses : actions/cache@v4
95+ - uses : Swatinem/rust-cache@v2
19096 with :
191- path : target
192- key : cargo-test-${{ runner.os }}-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
193- restore-keys : |
194- cargo-test-${{ runner.os }}-${{ matrix.toolchain }}-
97+ key : ${{ matrix.toolchain }}
19598 - run : cargo test --features tls12
19699 - name : Test no_std with alloc
197100 run : cargo test --no-default-features --features tls12,full,alloc
0 commit comments