1111 CARGO_TERM_COLOR : always
1212
1313jobs :
14- test :
15- name : Test Suite
16- runs-on : ${{ matrix.os }}
17- strategy :
18- matrix :
19- os : [ubuntu-latest, macos-latest]
20- rust : [stable]
21- steps :
22- - uses : actions/checkout@v4
23-
24- - name : Install Rust
25- uses : dtolnay/rust-toolchain@master
26- with :
27- toolchain : ${{ matrix.rust }}
28-
29- - name : Cache cargo registry
30- uses : actions/cache@v4
31- with :
32- path : ~/.cargo/registry
33- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34- restore-keys : |
35- ${{ runner.os }}-cargo-registry-
36-
37- - name : Cache cargo index
38- uses : actions/cache@v4
39- with :
40- path : ~/.cargo/git
41- key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
42- restore-keys : |
43- ${{ runner.os }}-cargo-index-
44-
45- - name : Cache target directory
46- uses : actions/cache@v4
47- with :
48- path : target
49- key : ${{ runner.os }}-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
50- restore-keys : |
51- ${{ runner.os }}-target-${{ matrix.rust }}-
52-
53- - name : Run tests
54- run : cargo test --all-features
55-
5614 fmt :
5715 name : Rustfmt
5816 runs-on : ubuntu-latest
@@ -67,15 +25,20 @@ jobs:
6725 - name : Check formatting
6826 run : cargo fmt --all -- --check
6927
70- clippy :
71- name : Clippy
72- runs-on : ubuntu-latest
28+ check :
29+ name : Check & Build
30+ runs-on : ${{ matrix.os }}
31+ strategy :
32+ matrix :
33+ os : [ubuntu-latest, macos-latest]
34+ rust : [stable]
7335 steps :
7436 - uses : actions/checkout@v4
7537
7638 - name : Install Rust
77- uses : dtolnay/rust-toolchain@stable
39+ uses : dtolnay/rust-toolchain@master
7840 with :
41+ toolchain : ${{ matrix.rust }}
7942 components : clippy
8043
8144 - name : Cache cargo registry
@@ -98,84 +61,21 @@ jobs:
9861 uses : actions/cache@v4
9962 with :
10063 path : target
101- key : ${{ runner.os }}-target-clippy -${{ hashFiles('**/Cargo.lock') }}
64+ key : ${{ runner.os }}-target-${{ matrix.rust }} -${{ hashFiles('**/Cargo.lock') }}
10265 restore-keys : |
103- ${{ runner.os }}-target-clippy -
66+ ${{ runner.os }}-target-${{ matrix.rust }} -
10467
10568 - name : Run clippy
10669 run : cargo clippy --all-targets --all-features -- -D warnings
10770
108- build :
109- name : Build
110- runs-on : ubuntu-latest
111- steps :
112- - uses : actions/checkout@v4
113-
114- - name : Install Rust
115- uses : dtolnay/rust-toolchain@stable
116-
117- - name : Cache cargo registry
118- uses : actions/cache@v4
119- with :
120- path : ~/.cargo/registry
121- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
122- restore-keys : |
123- ${{ runner.os }}-cargo-registry-
124-
125- - name : Cache cargo index
126- uses : actions/cache@v4
127- with :
128- path : ~/.cargo/git
129- key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
130- restore-keys : |
131- ${{ runner.os }}-cargo-index-
132-
133- - name : Cache target directory
134- uses : actions/cache@v4
135- with :
136- path : target
137- key : ${{ runner.os }}-target-build-${{ hashFiles('**/Cargo.lock') }}
138- restore-keys : |
139- ${{ runner.os }}-target-build-
140-
14171 - name : Build
14272 run : cargo build --all-features --verbose
14373
14474 - name : Build examples
14575 run : cargo build --examples --all-features --verbose
14676
147- doc :
148- name : Documentation
149- runs-on : ubuntu-latest
150- steps :
151- - uses : actions/checkout@v4
152-
153- - name : Install Rust
154- uses : dtolnay/rust-toolchain@stable
155-
156- - name : Cache cargo registry
157- uses : actions/cache@v4
158- with :
159- path : ~/.cargo/registry
160- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
161- restore-keys : |
162- ${{ runner.os }}-cargo-registry-
163-
164- - name : Cache cargo index
165- uses : actions/cache@v4
166- with :
167- path : ~/.cargo/git
168- key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
169- restore-keys : |
170- ${{ runner.os }}-cargo-index-
171-
172- - name : Cache target directory
173- uses : actions/cache@v4
174- with :
175- path : target
176- key : ${{ runner.os }}-target-doc-${{ hashFiles('**/Cargo.lock') }}
177- restore-keys : |
178- ${{ runner.os }}-target-doc-
77+ - name : Run tests
78+ run : cargo test --all-features
17979
18080 - name : Check documentation
18181 run : cargo doc --no-deps --all-features
0 commit comments