File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Rust code checks
1+ name : Rust (check, test, format, Clippy)
22
33on :
4+ push :
5+ branches-ignore :
6+ - " demo-gifs"
7+ - " gh-pages"
8+ - " samples"
49 pull_request :
510 branches-ignore :
611 - " demo-gifs"
712 - " gh-pages"
8- - " rust-demo"
913 - " samples"
1014
15+ env :
16+ CARGO_TERM_COLOR : always
17+
1118jobs :
12- rustfmt :
19+ check :
20+ name : cargo check
1321 runs-on : ubuntu-latest
1422
1523 steps :
16- - uses : actions/checkout@v3
24+ - uses : actions/checkout@v4
1725
1826 - uses : dtolnay/rust-toolchain@stable
1927
20- - name : Rustfmt check
21- uses : mbrobbel/rustfmt-check@master
28+ - uses : Swatinem/rust-cache@v2
29+
30+ - name : Cargo check
31+ run : cargo check --all
32+
33+ test :
34+ name : cargo test
35+ runs-on : ubuntu-latest
36+
37+ steps :
38+ - uses : actions/checkout@v4
39+
40+ - uses : dtolnay/rust-toolchain@stable
41+
42+ - uses : Swatinem/rust-cache@v2
43+
44+ - name : Run tests
45+ run : cargo test --all
46+
47+ fmt :
48+ name : rustfmt
49+ runs-on : ubuntu-latest
50+
51+ steps :
52+ - uses : actions/checkout@v4
53+
54+ - uses : dtolnay/rust-toolchain@stable
2255 with :
23- token : ${{ secrets.GITHUB_TOKEN }}
56+ components : rustfmt
57+
58+ - name : Rustfmt check
59+ run : cargo fmt --all -- --check
2460
2561 clippy :
62+ name : Clippy
2663 runs-on : ubuntu-latest
2764
2865 steps :
29- - uses : actions/checkout@v3
66+ - uses : actions/checkout@v4
67+
68+ - uses : dtolnay/rust-toolchain@stable
69+ with :
70+ components : clippy
3071
31- - name : Add clippy via rustup
32- run : rustup component add clippy
72+ - uses : Swatinem/rust-cache@v2
3373
3474 - name : Clippy check
35- uses : actions-rs/clippy-check@v1
36- with :
37- token : ${{ secrets.GITHUB_TOKEN }}
38- args : --all-features
75+ run : cargo clippy --all --no-deps -- -D warnings
You can’t perform that action at this time.
0 commit comments