1+ name : Quality
2+
3+ on :
4+ pull_request :
5+ push :
6+ branches :
7+ - main
8+
9+
10+ jobs :
11+ clippy_check :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v1
15+ - uses : actions-rs/toolchain@v1
16+ with :
17+ toolchain : stable
18+ profiles : minimal
19+ override : true
20+ components : rustfmt,clippy
21+ - name : Validate cargo format
22+ run : cargo fmt -- --check
23+ - name : Check workflow permissions
24+ id : check_permissions
25+ uses : scherermichael-oss/action-has-permission@1.0.6
26+ with :
27+ required-permission : write
28+ env :
29+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30+ - name : Run clippy action to produce annotations
31+ uses : actions-rs/clippy-check@v1
32+ if : steps.check_permissions.outputs.has-permission
33+ env :
34+ RUSTFLAGS : " -C target-cpu=native"
35+ with :
36+ token : ${{ secrets.GITHUB_TOKEN }}
37+ args : --all
38+ - name : Run clippy manually without annotations
39+ if : ${{ !steps.check_permissions.outputs.has-permission }}
40+ env :
41+ RUSTFLAGS : " -C target-cpu=native"
42+ run : cargo clippy --all
43+ coverage :
44+ runs-on : ubuntu-latest
45+ steps :
46+ - uses : actions/checkout@v1
47+ - uses : actions-rs/toolchain@v1
48+ with :
49+ toolchain : stable
50+ profile : minimal
51+ components : llvm-tools-preview
52+ - name : Install cargo-llvm-cov
53+ uses : taiki-e/install-action@cargo-llvm-cov
54+ - name : Run codecov
55+ env :
56+ RUSTFLAGS : " -C target-cpu=native"
57+ run : cargo llvm-cov --lcov --output-path lcov.txt
58+ - uses : codecov/codecov-action@v3
59+ with :
60+ files : ./lcov.txt # optional
61+ flags : ${{ env.flags }} # optional
62+ fail_ci_if_error : true # optional (default = false)
63+ verbose : true # optional (default = false)
0 commit comments