21
21
components : rustfmt, clippy
22
22
override : true
23
23
24
+ - name : Cache Rust toolchain
25
+ uses : actions/cache@v3
26
+ id : rust-toolchain
27
+ with :
28
+ paths :
29
+ - $HOME/.cargo/
30
+ key : ${{ runner.os }}-rust-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
31
+ restore-keys : |
32
+ ${{ runner.os }}-rust-
33
+
24
34
- name : Check no default features
25
35
run : cargo check --no-default-features
26
36
@@ -30,11 +40,54 @@ jobs:
30
40
- name : Lint with Clippy
31
41
run : cargo clippy --workspace --all-features --bins --tests
32
42
43
+ - name : Cache build artifacts
44
+ uses : actions/cache@v3
45
+ id : build-cache
46
+ with :
47
+ paths :
48
+ - target/
49
+ key : ${{ runner.os }}-build-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
50
+ restore-keys : |
51
+ ${{ runner.os }}-build-
52
+
33
53
- name : Build
34
54
run : cargo build --release --workspace --all-features --verbose
35
55
36
- - name : Run tests
37
- run : cargo test --all-features --workspace --verbose
56
+ - name : Install Nextest
57
+ run : cargo install nextest
58
+
59
+ - name : Cache Nextest
60
+ uses : actions/cache@v3
61
+ id : nextest-cache
62
+ with :
63
+ paths :
64
+ - $HOME/.cargo/bin/nextest
65
+ key : ${{ runner.os }}-nextest-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
66
+ restore-keys : |
67
+ ${{ runner.os }}-nextest-
68
+
69
+ - name : Run tests with Nextest
70
+ run : cargo nextest run --all-features --workspace --verbose
71
+
72
+ - name : Cache test results
73
+ uses : actions/cache@v3
74
+ id : test-results
75
+ with :
76
+ paths :
77
+ - target/cargo-nextest-reports/
78
+ key : ${{ runner.os }}-test-results-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
79
+ restore-keys : |
80
+ ${{ runner.os }}-test-results-
38
81
39
82
- name : Run docs
40
83
run : cargo doc --workspace --all-features --no-deps --document-private-items --verbose
84
+
85
+ - name : Cache documentation
86
+ uses : actions/cache@v3
87
+ id : docs-cache
88
+ with :
89
+ paths :
90
+ - target/doc/
91
+ key : ${{ runner.os }}-docs-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
92
+ restore-keys : |
93
+ ${{ runner.os }}-docs-
0 commit comments