@@ -3,53 +3,29 @@ name: Formatting and Linting
33on : [push, pull_request]
44
55jobs :
6- check :
6+ fmt :
7+ name : Cargo fmt
78 runs-on : ubuntu-latest
89 steps :
910 - uses : actions/checkout@v3
10- - uses : dtolnay/rust-toolchain@stable
11+ - uses : dtolnay/rust-toolchain@nightly
12+ with :
13+ components : rustfmt
1114 - uses : Swatinem/rust-cache@v2
12-
1315 - name : Run fmt check
1416 id : cargoFmt
1517 shell : bash
16- run : cargo fmt --all -- --check
17- - name : Notify fmt check
18- if : failure() && steps.cargoFmt.outcome == 'failure'
19- uses : actions/github-script@v6
20- with :
21- script : |
22- const message = `👋 It looks like your code is not formatted like we expect.
23-
24- Please run \`cargo fmt\` and push the code again.`;
25-
26- await github.rest.issues.createComment({
27- issue_number : context.issue.number,
28- owner : context.repo.owner,
29- repo : context.repo.repo,
30- body : message,
31- });
32- core.setFailed('It looks like there are formatting errors');
33-
18+ run : cargo +nightly fmt --all -- --check
19+ clippy :
20+ name : Cargo clippy
21+ runs-on : ubuntu-latest
22+ steps :
23+ - uses : actions/checkout@v3
24+ - uses : dtolnay/rust-toolchain@stable
25+ - uses : Swatinem/rust-cache@v2
3426 - name : Run clippy check
3527 id : cargoClippy
3628 shell : bash
3729 run : cargo clippy --workspace --all-features -- -D warnings
38- - name : Notify fmt check
39- if : failure() && steps.cargoClippy.outcome == 'failure'
40- uses : actions/github-script@v6
41- with :
42- script : |
43- const message = `👋 It looks like your code has some linting issues.
44-
45- Please run \`cargo clippy --fix\` and push the code again.`;
46-
47- await github.rest.issues.createComment({
48- issue_number : context.issue.number,
49- owner : context.repo.owner,
50- repo : context.repo.repo,
51- body : message,
52- });
53- core.setFailed('It looks like there are linting errors');
5430
5531
0 commit comments