11name : CI
2+
3+ permissions :
4+ contents : read
5+
26on :
37 pull_request :
4- paths :
5- - ' **'
6- - ' !/*.md'
7- - ' !/docs/**'
8- - " !/LICENSE-*"
98 push :
109 branches :
1110 - master
12- paths :
13- - ' **'
14- - ' !/*.md'
15- - ' !/docs/**'
16- - " !/LICENSE-*"
17- schedule :
18- - cron : ' 13 13 13 * *'
11+
12+ env :
13+ RUST_BACKTRACE : 1
14+ CARGO_TERM_COLOR : always
15+ CLICOLOR : 1
16+
1917jobs :
2018 ci :
19+ permissions :
20+ contents : none
2121 name : CI
2222 needs : [test, msrv, docs, rustfmt, clippy]
2323 runs-on : ubuntu-latest
3636 - name : Checkout repository
3737 uses : actions/checkout@v3
3838 - name : Install Rust
39- uses : actions-rs/ toolchain@v1
39+ uses : dtolnay/rust- toolchain@stable
4040 with :
4141 toolchain : ${{ matrix.rust }}
42- profile : minimal
43- override : true
4442 - uses : Swatinem/rust-cache@v2
4543 - name : Build
4644 run : cargo test --no-run --workspace --all-features
@@ -51,17 +49,15 @@ jobs:
5149 - name : No-default features
5250 run : cargo test --workspace --no-default-features
5351 msrv :
54- name : " Check MSRV: 1.64 .0"
52+ name : " Check MSRV: 1.65 .0"
5553 runs-on : ubuntu-latest
5654 steps :
5755 - name : Checkout repository
5856 uses : actions/checkout@v3
5957 - name : Install Rust
60- uses : actions-rs/ toolchain@v1
58+ uses : dtolnay/rust- toolchain@stable
6159 with :
62- toolchain : 1.64.0 # MSRV
63- profile : minimal
64- override : true
60+ toolchain : 1.65.0 # MSRV
6561 - uses : Swatinem/rust-cache@v2
6662 - name : Default features
6763 run : cargo check --workspace --all-targets
7672 - name : Checkout repository
7773 uses : actions/checkout@v3
7874 - name : Install Rust
79- uses : actions-rs/ toolchain@v1
75+ uses : dtolnay/rust- toolchain@stable
8076 with :
8177 toolchain : stable
82- profile : minimal
83- override : true
8478 - uses : Swatinem/rust-cache@v2
8579 - name : Check documentation
8680 env :
@@ -93,32 +87,42 @@ jobs:
9387 - name : Checkout repository
9488 uses : actions/checkout@v3
9589 - name : Install Rust
96- uses : actions-rs/ toolchain@v1
90+ uses : dtolnay/rust- toolchain@stable
9791 with :
9892 # Not MSRV because its harder to jump between versions and people are
9993 # more likely to have stable
10094 toolchain : stable
101- profile : minimal
102- override : true
10395 components : rustfmt
10496 - uses : Swatinem/rust-cache@v2
10597 - name : Check formatting
10698 run : cargo fmt --all -- --check
10799 clippy :
108100 name : clippy
109101 runs-on : ubuntu-latest
102+ permissions :
103+ security-events : write # to upload sarif results
110104 steps :
111105 - name : Checkout repository
112106 uses : actions/checkout@v3
113107 - name : Install Rust
114- uses : actions-rs/ toolchain@v1
108+ uses : dtolnay/rust- toolchain@stable
115109 with :
116- toolchain : 1.64.0 # MSRV
117- profile : minimal
118- override : true
110+ toolchain : 1.65.0 # MSRV
119111 components : clippy
120112 - uses : Swatinem/rust-cache@v2
121- - uses : actions-rs/clippy-check@v1
113+ - name : Install SARIF tools
114+ run : cargo install clippy-sarif --version 0.3.4 --locked # Held back due to msrv
115+ - name : Install SARIF tools
116+ run : cargo install sarif-fmt --version 0.3.4 --locked # Held back due to msrv
117+ - name : Check
118+ run : >
119+ cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
120+ | clippy-sarif
121+ | tee clippy-results.sarif
122+ | sarif-fmt
123+ continue-on-error : true
124+ - name : Upload
125+ uses : github/codeql-action/upload-sarif@v2
122126 with :
123- token : ${{ secrets.GITHUB_TOKEN }}
124- args : --workspace --all-features --all-targets -- -D warnings --allow deprecated
127+ sarif_file : clippy-results.sarif
128+ wait-for-processing : true
0 commit comments