-
Notifications
You must be signed in to change notification settings - Fork 0
243 lines (205 loc) · 7.1 KB
/
Copy pathci.yml
File metadata and controls
243 lines (205 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: CI
on:
# TODO re-enable once project is set up properly
# push:
# branches:
# - main
# pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CI: 1
jobs:
clippy:
name: Clippy validation
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust with clippy
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: stable
components: clippy
cache: false
- name: Rust Cache
# Temporary fork of `Swatinem/rust-cache` with support for caching `cargo binstall`ed binaries
# Should be switched if this feature is merged in the main action: https://github.com/Swatinem/rust-cache/pull/325
uses: clechasseur/rust-cache@45dfca100f1e255035d993b3dc7a8c356de54bf8
with:
prefix-key: v1.0.0-rust
cache-on-failure: true
- name: Setup cargo-binstall
uses: cargo-bins/cargo-binstall@v1.17.9
with:
version: v1.17.9
- name: Install cargo-hack
uses: clechasseur/rs-cargo@v5.0.5
with:
command: binstall
args: -y cargo-hack@0.6.44
- name: Run clippy
uses: clechasseur/rs-clippy-check@v6.0.4
with:
args: --workspace --all-targets --feature-powerset -- -D warnings
tool: cargo-hack
cache-key: v1-clippy
fmt:
name: Rustfmt check
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust nightly with rustfmt
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: nightly
components: rustfmt
cache: false
- name: Run Rustfmt
uses: clechasseur/rs-fmt-check@v4.0.4
with:
args: --all
msrv-check:
name: MSRV check on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-24.04, macos-15, windows-2025 ]
toolchain: [ 1.60.0 ] # TODO: change for your minimum supported Rust version
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust nightly and ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: nightly,${{ matrix.toolchain }}
cache: false
- name: Rust Cache
uses: clechasseur/rust-cache@45dfca100f1e255035d993b3dc7a8c356de54bf8
with:
prefix-key: v1.0.0-rust
key: msrv-pins-files-${{ hashFiles('**/msrv-pins.toml') }}
cache-on-failure: true
- name: Setup cargo-binstall
uses: cargo-bins/cargo-binstall@v1.17.9
with:
version: v1.17.9
- name: Install required tools
uses: clechasseur/rs-cargo@v5.0.5
with:
command: binstall
args: -y just@1.48.1 cargo-hack@0.6.44 cargo-minimal-versions@0.1.37 cargo-msrv-prep@2.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run checks using cargo-minimal-versions
run: just toolchain=${{ matrix.toolchain }} check-minimal
build:
name: Build on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-24.04, macos-15, windows-2025 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: stable
cache: false
- name: Rust Cache
uses: clechasseur/rust-cache@45dfca100f1e255035d993b3dc7a8c356de54bf8
with:
prefix-key: v1.0.0-rust
cache-on-failure: true
- name: Setup cargo-binstall
uses: cargo-bins/cargo-binstall@v1.17.9
with:
version: v1.17.9
- name: Install required tools
uses: clechasseur/rs-cargo@v5.0.5
with:
command: binstall
args: -y just@1.48.1 cargo-hack@0.6.44
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run checks on feature powerset
run: just check-powerset
- name: Run tests
run: just test
llvm-cov:
name: Code coverage with llvm-cov
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust nightly
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: nightly
cache: false
- name: Rust Cache
uses: clechasseur/rust-cache@45dfca100f1e255035d993b3dc7a8c356de54bf8
with:
prefix-key: v1.0.0-rust
cache-targets: false
cache-on-failure: true
- name: Setup cargo-binstall
uses: cargo-bins/cargo-binstall@v1.17.9
with:
version: v1.17.9
- name: Install required tools
uses: clechasseur/rs-cargo@v5.0.5
with:
command: binstall
args: -y just@1.48.1 cargo-llvm-cov@0.8.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo-llvm-cov
run: just llvm-cov
- name: Upload code coverage results to codecov.io
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
- name: Archive code coverage results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: llvm-cov-code-coverage-report
path: |
codecov.json
target/llvm-cov/html/
doc:
name: Rustdoc check
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust nightly
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: nightly
cache: false
- name: Rust Cache
uses: clechasseur/rust-cache@45dfca100f1e255035d993b3dc7a8c356de54bf8
with:
prefix-key: v1.0.0-rust
cache-targets: false
cache-on-failure: true
- name: Setup cargo-binstall
uses: cargo-bins/cargo-binstall@v1.17.9
with:
version: v1.17.9
- name: Install just
uses: clechasseur/rs-cargo@v5.0.5
with:
command: binstall
args: -y just@1.48.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate doc using rustdoc
run: just toolchain=nightly doc