88 name : Lint Codebase
99 runs-on : ubuntu-latest
1010 steps :
11- - name : Checkout Project
12- uses : actions/checkout@v3
13- with :
14- fetch-depth : 0
15-
16- - name : Setup Rust
17- uses : actions-rs/toolchain@v1
18- with :
19- toolchain : stable
20- override : true
21- components : rustfmt, clippy
22- profile : minimal
11+ - uses : actions/checkout@v6
2312
24- - name : Setup WebAssembly Target
25- uses : actions-rs/ toolchain@v1
13+ - name : Setup toolchain
14+ uses : dtolnay/rust- toolchain@master
2615 with :
2716 toolchain : stable
28- target : wasm32-unknown-unknown
29- profile : minimal
30-
31- - name : Restore Rust Cache
32- uses : Swatinem/rust-cache@v2
33-
34- - name : Run Lints
35- if : github.event_name == 'push'
36- uses : actions-rs/clippy-check@v1
37- with :
38- token : ${{ secrets.GITHUB_TOKEN }}
39- args : --all-features
17+ components : clippy
18+ targets : wasm32-unknown-unknown
4019
41- - name : Run Lints (WebAssembly)
42- if : github.event_name == 'push'
43- uses : actions-rs/clippy-check@v1
20+ - uses : Swatinem/rust-cache@v2
4421 with :
45- token : ${{ secrets.GITHUB_TOKEN }}
46- args : --all-features --target=wasm32-unknown-unknown
22+ save-if : ${{ github.ref == 'refs/heads/master' }}
4723
48- - name : Run Lints (PR)
49- if : github.event_name == 'pull_request'
24+ - name : Run clippy
5025 run : cargo clippy --all-features
5126
52- - name : Run Lints (PR)
53- if : github.event_name == 'pull_request'
27+ - name : Run clippy (WebAssembly)
5428 run : cargo clippy --all-features --target=wasm32-unknown-unknown
5529
5630 test :
5731 name : Run Tests
5832 runs-on : ubuntu-latest
5933 steps :
60- - name : Checkout Project
61- uses : actions/checkout@v3
62- with :
63- fetch-depth : 0
34+ - uses : actions/checkout@v6
6435
65- - name : Setup Rust
66- uses : actions-rs/ toolchain@v1
36+ - name : Setup toolchain
37+ uses : dtolnay/rust- toolchain@master
6738 with :
6839 toolchain : stable
69- override : true
70- components : rustfmt, clippy
71- profile : minimal
7240
73- - name : Restore Rust Cache
74- uses : Swatinem/rust-cache@v2
41+ - uses : Swatinem/rust-cache@v2
42+ with :
43+ save-if : ${{ github.ref == 'refs/heads/master' }}
7544
76- - name : Run Tests
45+ - name : Run tests
7746 run : cargo test --all-features
7847
7948 publish :
@@ -84,36 +53,25 @@ jobs:
8453 - test
8554 if : github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
8655 steps :
87- - name : Checkout Project
88- uses : actions/checkout@v3
89- with :
90- fetch-depth : 0
56+ - uses : actions/checkout@v6
9157
92- - name : Setup Rust
93- uses : actions-rs/ toolchain@v1
58+ - name : Setup toolchain
59+ uses : dtolnay/rust- toolchain@master
9460 with :
9561 toolchain : stable
96- override : true
97- components : rustfmt, clippy
98- profile : minimal
9962
100- - name : Restore Rust Cache
101- uses : Swatinem/rust-cache@v2
63+ - uses : Swatinem/rust-cache@v2
64+ with :
65+ save-if : ${{ github.ref == 'refs/heads/master' }}
10266
10367 - name : Run cargo publish --dry-run
104- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
105- uses : actions-rs/cargo@v1
106- with :
107- command : publish
108- args : --dry-run
68+ if : github.ref == 'refs/heads/master'
69+ run : cargo publish --dry-run
10970 env :
11071 RUSTFLAGS : " --cfg releasing"
11172
11273 - name : Run cargo publish
113- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
114- uses : actions-rs/cargo@v1
115- with :
116- command : publish
117- args : --token ${{ secrets.CRATES_IO_TOKEN }}
74+ if : startsWith(github.ref, 'refs/tags/')
75+ run : cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
11876 env :
11977 RUSTFLAGS : " --cfg releasing"
0 commit comments