11name : Rust
22
3- on : [push, pull_request]
3+ on :
4+ pull_request :
5+ push :
6+ branches :
7+ - main
48
59env :
610 CARGO_TERM_COLOR : always
@@ -10,88 +14,63 @@ jobs:
1014 name : Test
1115 runs-on : ubuntu-latest
1216 steps :
13- - uses : actions/checkout@v2
14- - uses : actions-rs/toolchain@v1
15- with :
16- profile : minimal
17- toolchain : stable
18- override : true
19- - uses : Swatinem/rust-cache@v1
20- - uses : actions-rs/cargo@v1
21- with :
22- command : test
17+ - uses : actions/checkout@v5
18+ - name : Install Rust stable toolchain
19+ uses :
actions-rust-lang/[email protected] 20+ - name : Test
21+ run : |
22+ cargo test
2323
2424 fmt :
2525 name : Rustfmt
2626 runs-on : ubuntu-latest
2727 steps :
28- - uses : actions/checkout@v2
29- - uses : actions-rs/toolchain@v1
30- with :
31- profile : minimal
32- toolchain : stable
33- override : true
34- components : rustfmt
35- - uses : Swatinem/rust-cache@v1
36- - uses : actions-rs/cargo@v1
37- with :
38- command : fmt
39- args : --all -- --check
28+ - uses : actions/checkout@v5
29+ - name : Install Rust stable toolchain
30+ uses :
actions-rust-lang/[email protected] 31+ - name : Format
32+ run : |
33+ cargo fmt --all -- --check
4034
4135 clippy :
4236 name : Clippy
4337 runs-on : ubuntu-latest
4438 steps :
4539 - name : Checkout repository
46- uses : actions/checkout@v2
47- - uses : actions-rs/toolchain@v1
48- with :
49- profile : minimal
50- toolchain : stable
51- override : true
52- components : clippy
53- - uses : Swatinem/rust-cache@v1
54- - uses : actions-rs/cargo@v1
55- with :
56- command : clippy
57- args : -- -D warnings
40+ uses : actions/checkout@v5
41+ - name : Install Rust stable toolchain
42+ uses :
actions-rust-lang/[email protected] 43+ - name : Lint
44+ run : |
45+ cargo clippy -- -D warnings
5846
5947 docs :
6048 name : Docs
6149 runs-on : ubuntu-latest
6250 steps :
6351 - name : Checkout repository
64- uses : actions/checkout@v2
65- - name : Install Rust
66- uses : actions-rs/toolchain@v1
67- with :
68- toolchain : stable
69- profile : minimal
70- override : true
71- - uses : Swatinem/rust-cache@v1
72- - name : Check documentation
73- env :
74- RUSTDOCFLAGS : -D warnings
75- uses : actions-rs/cargo@v1
76- with :
77- command : doc
78- args : --no-deps --document-private-items
52+ uses : actions/checkout@v5
53+ - name : Install Rust stable toolchain
54+ uses :
actions-rust-lang/[email protected] 55+ - name : Document
56+ run : |
57+ cargo doc --no-deps --document-private-items
7958
8059 coverage :
81- name : Code coverage
8260 runs-on : ubuntu-latest
61+ env :
62+ CARGO_TERM_COLOR : always
8363 steps :
84- - name : Checkout repository
85- uses : actions/checkout@v2
86-
87- - name : Install stable toolchain
88- uses : actions-rs/toolchain@v1
89- with :
90- toolchain : stable
91- override : true
92-
93- - uses : Swatinem/rust-cache@v1
94- - name : Run cargo-tarpaulin
95- uses :
actions-rs/[email protected] 64+ - uses : actions/checkout@v5
65+ - name : Install Rust stable toolchain
66+ uses :
actions-rust-lang/[email protected] 67+ - name : Install cargo-llvm-cov
68+ uses : taiki-e/install-action@cargo-llvm-cov
69+ - name : Generate code coverage
70+ run : cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json
71+ - name : Upload coverage to Codecov
72+ uses : codecov/codecov-action@v3
9673 with :
97- args : ' --ignore-tests'
74+ token : ${{ secrets.CODECOV_TOKEN }}
75+ files : codecov.json
76+ fail_ci_if_error : true
0 commit comments