14
14
CARGO_TERM_COLOR : always
15
15
CLICOLOR : 1
16
16
17
+ concurrency :
18
+ group : " ${{ github.workflow }}-${{ github.ref }}"
19
+ cancel-in-progress : true
20
+
17
21
jobs :
18
22
ci :
19
23
permissions :
20
24
contents : none
21
25
name : CI
22
- needs : [test, msrv, docs, rustfmt, clippy]
26
+ needs : [test, msrv, lockfile, docs, rustfmt, clippy, minimal-versions ]
23
27
runs-on : ubuntu-latest
28
+ if : " always()"
24
29
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')"
27
33
test :
28
34
name : Test
29
35
strategy :
@@ -49,22 +55,40 @@ jobs:
49
55
- name : No-default features
50
56
run : cargo test --workspace --no-default-features
51
57
msrv :
52
- name : " Check MSRV: 1.83.0 "
58
+ name : " Check MSRV"
53
59
runs-on : ubuntu-latest
54
60
steps :
55
61
- name : Checkout repository
56
62
uses : actions/checkout@v4
57
63
- name : Install Rust
58
64
uses : dtolnay/rust-toolchain@stable
59
65
with :
60
- toolchain : " 1.83.0 " # MSRV
66
+ toolchain : stable
61
67
- uses : Swatinem/rust-cache@v2
62
68
- name : Default features
63
69
run : cargo check --workspace --all-targets
64
70
- name : All features
65
71
run : cargo check --workspace --all-targets --all-features
66
72
- name : No-default features
67
73
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
68
92
lockfile :
69
93
runs-on : ubuntu-latest
70
94
steps :
76
100
toolchain : stable
77
101
- uses : Swatinem/rust-cache@v2
78
102
- name : " Is lockfile updated?"
79
- run : cargo fetch --locked
103
+ run : cargo update --workspace --locked
80
104
docs :
81
105
name : Docs
82
106
runs-on : ubuntu-latest
86
110
- name : Install Rust
87
111
uses : dtolnay/rust-toolchain@stable
88
112
with :
89
- toolchain : stable
113
+ toolchain : " 1.84 " # STABLE
90
114
- uses : Swatinem/rust-cache@v2
91
115
- name : Check documentation
92
116
env :
@@ -101,9 +125,7 @@ jobs:
101
125
- name : Install Rust
102
126
uses : dtolnay/rust-toolchain@stable
103
127
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
107
129
components : rustfmt
108
130
- uses : Swatinem/rust-cache@v2
109
131
- name : Check formatting
@@ -119,16 +141,16 @@ jobs:
119
141
- name : Install Rust
120
142
uses : dtolnay/rust-toolchain@stable
121
143
with :
122
- toolchain : " 1.83.0 " # MSRV
144
+ toolchain : " 1.84 " # STABLE
123
145
components : clippy
124
146
- uses : Swatinem/rust-cache@v2
125
147
- 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
127
149
- 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
129
151
- name : Check
130
152
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
132
154
| clippy-sarif
133
155
| tee clippy-results.sarif
134
156
| sarif-fmt
@@ -140,3 +162,22 @@ jobs:
140
162
wait-for-processing : true
141
163
- name : Report status
142
164
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