1414 CARGO_TERM_COLOR : always
1515 CLICOLOR : 1
1616
17+ concurrency :
18+ group : " ${{ github.workflow }}-${{ github.ref }}"
19+ cancel-in-progress : true
20+
1721jobs :
1822 ci :
1923 permissions :
2024 contents : none
2125 name : CI
22- needs : [test, msrv, docs, rustfmt, clippy]
26+ needs : [test, msrv, lockfile, docs, rustfmt, clippy, minimal-versions ]
2327 runs-on : ubuntu-latest
28+ if : " always()"
2429 steps :
25- - name : Done
26- run : exit 0
30+ - name : Failed
31+ run : exit 1
32+ if : " contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')"
2733 test :
2834 name : Test
2935 strategy :
@@ -49,22 +55,40 @@ jobs:
4955 - name : No-default features
5056 run : cargo test --workspace --no-default-features
5157 msrv :
52- name : " Check MSRV: 1.83.0 "
58+ name : " Check MSRV"
5359 runs-on : ubuntu-latest
5460 steps :
5561 - name : Checkout repository
5662 uses : actions/checkout@v4
5763 - name : Install Rust
5864 uses : dtolnay/rust-toolchain@stable
5965 with :
60- toolchain : " 1.83.0 " # MSRV
66+ toolchain : stable
6167 - uses : Swatinem/rust-cache@v2
6268 - name : Default features
6369 run : cargo check --workspace --all-targets
6470 - name : All features
6571 run : cargo check --workspace --all-targets --all-features
6672 - name : No-default features
6773 run : cargo check --workspace --all-targets --no-default-features
74+ minimal-versions :
75+ name : Minimal versions
76+ runs-on : ubuntu-latest
77+ steps :
78+ - name : Checkout repository
79+ uses : actions/checkout@v4
80+ - name : Install stable Rust
81+ uses : dtolnay/rust-toolchain@stable
82+ with :
83+ toolchain : stable
84+ - name : Install nightly Rust
85+ uses : dtolnay/rust-toolchain@stable
86+ with :
87+ toolchain : nightly
88+ - name : Downgrade dependencies to minimal versions
89+ run : cargo +nightly generate-lockfile -Z minimal-versions
90+ - name : Compile with minimal versions
91+ run : cargo +stable check --workspace --all-features --locked
6892 lockfile :
6993 runs-on : ubuntu-latest
7094 steps :
76100 toolchain : stable
77101 - uses : Swatinem/rust-cache@v2
78102 - name : " Is lockfile updated?"
79- run : cargo fetch --locked
103+ run : cargo update --workspace --locked
80104 docs :
81105 name : Docs
82106 runs-on : ubuntu-latest
86110 - name : Install Rust
87111 uses : dtolnay/rust-toolchain@stable
88112 with :
89- toolchain : stable
113+ toolchain : " 1.84 " # STABLE
90114 - uses : Swatinem/rust-cache@v2
91115 - name : Check documentation
92116 env :
@@ -101,9 +125,7 @@ jobs:
101125 - name : Install Rust
102126 uses : dtolnay/rust-toolchain@stable
103127 with :
104- # Not MSRV because its harder to jump between versions and people are
105- # more likely to have stable
106- toolchain : stable
128+ toolchain : " 1.84" # STABLE
107129 components : rustfmt
108130 - uses : Swatinem/rust-cache@v2
109131 - name : Check formatting
@@ -119,16 +141,16 @@ jobs:
119141 - name : Install Rust
120142 uses : dtolnay/rust-toolchain@stable
121143 with :
122- toolchain : " 1.83.0 " # MSRV
144+ toolchain : " 1.84 " # STABLE
123145 components : clippy
124146 - uses : Swatinem/rust-cache@v2
125147 - name : Install SARIF tools
126- run : cargo install clippy-sarif --version 0.3.4 -- locked # Held back due to msrv
148+ run : cargo install clippy-sarif --locked
127149 - name : Install SARIF tools
128- run : cargo install sarif-fmt --version 0.3.4 -- locked # Held back due to msrv
150+ run : cargo install sarif-fmt --locked
129151 - name : Check
130152 run : >
131- cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
153+ cargo clippy --workspace --all-features --all-targets --message-format=json
132154 | clippy-sarif
133155 | tee clippy-results.sarif
134156 | sarif-fmt
@@ -140,3 +162,22 @@ jobs:
140162 wait-for-processing : true
141163 - name : Report status
142164 run : cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
165+ coverage :
166+ name : Coverage
167+ runs-on : ubuntu-latest
168+ steps :
169+ - name : Checkout repository
170+ uses : actions/checkout@v4
171+ - name : Install Rust
172+ uses : dtolnay/rust-toolchain@stable
173+ with :
174+ toolchain : stable
175+ - uses : Swatinem/rust-cache@v2
176+ - name : Install cargo-tarpaulin
177+ run : cargo install cargo-tarpaulin
178+ - name : Gather coverage
179+ run : cargo tarpaulin --output-dir coverage --out lcov
180+ - name : Publish to Coveralls
181+ uses : coverallsapp/github-action@master
182+ with :
183+ github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments