Debian Codegraph @

.github/workflows/main.yml

raw symbols SCIP
1 on:
2 pull_request:
3 types: [opened, synchronize, reopened]
4 push:
5 branches:
6 - master
7 - "[1-9].x"
8
9 name: CI
10
11 jobs:
12 ci:
13 runs-on: ubuntu-latest
14 # Keep this the same as this is what Github looks for to determine if the build passed
15 name: "Pass"
16 needs:
17 - check_style
18 - minimum_rust_version
19 - docs
20 - test
21 steps:
22 - run: exit 0
23
24 check_style:
25 name: Check file formatting and style
26 runs-on: ubuntu-latest
27 steps:
28 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
29
30 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
31 with:
32 toolchain: stable
33 components: clippy, rustfmt
34
35 - name: Cache cargo registry
36 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
37 with:
38 path: |
39 ~/.cargo/registry
40 ~/.cargo/git
41 key: clippy-cargo-${{ hashFiles('**/Cargo.toml') }}
42
43 - name: Install dependencies
44 run: |
45 sudo apt-get update
46 sudo apt-get -y install libpq-dev
47
48 - name: Check file formatting
49 run: cargo fmt --all -- --check
50
51 - name: Run clippy
52 run: cargo clippy --workspace --all-features
53
54 minimum_rust_version:
55 name: Check minimum rust version
56 runs-on: ubuntu-latest
57 steps:
58 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
59
60 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
61 with:
62 toolchain: 1.67.1
63
64 - name: Cache cargo registry
65 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
66 with:
67 path: |
68 ~/.cargo/registry
69 ~/.cargo/git
70 key: minimal_rust_version-cargo-${{ hashFiles('**/Cargo.toml') }}
71
72 - name: Install dependencies
73 run: |
74 sudo apt-get update
75 sudo apt-get -y install libpq-dev
76
77 - name: Use minimal dependencies
78 run: |
79 RUSTC_BOOTSTRAP=1 cargo update -Z minimal-versions
80
81 - name: Check build
82 run: cargo check --workspace
83
84 docs:
85 name: "Check documentation"
86 runs-on: ubuntu-latest
87 steps:
88 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
89
90 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
91 with:
92 toolchain: nightly
93
94 - name: Cache cargo registry
95 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
96 with:
97 path: |
98 ~/.cargo/registry
99 ~/.cargo/git
100 key: docs-cargo-${{ hashFiles('**/Cargo.toml') }}
101
102 - name: Check documentation
103 env:
104 RUSTDOCFLAGS: --cfg docsrs
105 run: cargo doc --no-deps --all-features
106
107 test:
108 name: "Test"
109 runs-on: ubuntu-latest
110 needs:
111 - standard_tests
112 - dependency_tests
113 - database_tests
114 - wasm_tests
115 - fuzz_tests
116 steps:
117 - run: exit 0
118
119 standard_tests:
120 name: "Standard Tests"
121 runs-on: ubuntu-latest
122 strategy:
123 # There doesn't seem to be a way to share the matrix between jobs
124 matrix:
125 name:
126 - stable
127 - beta
128 include:
129 - name: stable
130 rust: stable
131 - name: beta
132 rust: beta
133 steps:
134 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
135
136 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
137 with:
138 toolchain: ${{ matrix.rust }}
139 targets: ${{ matrix.target }}
140
141 - name: Cache cargo registry
142 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
143 with:
144 path: |
145 ~/.cargo/registry
146 ~/.cargo/git
147 key: tests-std-${{ matrix.rust }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.toml') }}
148
149 - uses: davidB/rust-cargo-make@291dc18d931d07d4960a5c40e9b6afcea9287f5b # v1.15.0
150
151 - name: Run no_std tests
152 run: cargo make test-no-std
153
154 - name: Run default tests
155 run: cargo make test-default
156
157 - name: Run legacy operation tests
158 run: cargo make test-legacy-ops
159
160 - name: Run mathematical function tests
161 run: cargo make test-maths
162
163 - name: Run macro tests
164 run: cargo make test-macros
165
166 dependency_tests:
167 name: "Dependency Tests"
168 runs-on: ubuntu-latest
169 strategy:
170 # There doesn't seem to be a way to share the matrix between jobs
171 matrix:
172 name:
173 - stable
174 - beta
175 include:
176 - name: stable
177 rust: stable
178 - name: beta
179 rust: beta
180 steps:
181 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
182
183 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
184 with:
185 toolchain: ${{ matrix.rust }}
186 targets: ${{ matrix.target }}
187
188 - name: Cache cargo registry
189 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
190 with:
191 path: |
192 ~/.cargo/registry
193 ~/.cargo/git
194 key: tests-dep-${{ matrix.rust }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.toml') }}
195
196 - uses: davidB/rust-cargo-make@291dc18d931d07d4960a5c40e9b6afcea9287f5b # v1.15.0
197
198 - name: Run serde tests
199 run: cargo make test-serde
200
201 - name: Run miscellaneous dependency tests
202 run: cargo make test-misc
203
204 database_tests:
205 name: "Database Tests"
206 runs-on: ubuntu-latest
207 needs:
208 - postgres_tests
209 - mysql_tests
210 steps:
211 - run: exit 0
212
213 postgres_tests:
214 name: "Database Tests - PostgreSQL"
215 runs-on: ubuntu-latest
216 strategy:
217 # There doesn't seem to be a way to share the matrix between jobs
218 matrix:
219 name:
220 - stable
221 - beta
222 include:
223 # This allows us to define targets in the future (e.g. wasm32-unknown-unknown)
224 - name: stable
225 rust: stable
226 - name: beta
227 rust: beta
228 services:
229 postgres:
230 image: postgres:11.6
231 env:
232 POSTGRES_PASSWORD: ""
233 ports:
234 - 5432:5432
235 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
236 steps:
237 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
238
239 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
240 with:
241 toolchain: ${{ matrix.rust }}
242 targets: ${{ matrix.target }}
243
244 - name: Cache cargo registry
245 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
246 with:
247 path: |
248 ~/.cargo/registry
249 ~/.cargo/git
250 key: tests-pgsql-${{ matrix.rust }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.toml') }}
251
252 - uses: davidB/rust-cargo-make@291dc18d931d07d4960a5c40e9b6afcea9287f5b # v1.15.0
253
254 - name: Install dependencies
255 run: |
256 sudo apt-get update
257 sudo apt-get -y install libpq-dev
258
259 - name: Run database tests
260 run: cargo make test-db-postgres-all
261
262 mysql_tests:
263 name: "Database Tests - MySQL"
264 runs-on: ubuntu-latest
265 strategy:
266 # There doesn't seem to be a way to share the matrix between jobs
267 matrix:
268 name:
269 - stable
270 - beta
271 include:
272 # This allows us to define targets in the future (e.g. wasm32-unknown-unknown)
273 - name: stable
274 rust: stable
275 - name: beta
276 rust: beta
277 services:
278 mysql:
279 image: mysql:8
280 env:
281 MYSQL_ROOT_PASSWORD: ""
282 MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
283 ports:
284 - 3306:3306
285 steps:
286 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
287
288 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
289 with:
290 toolchain: ${{ matrix.rust }}
291 targets: ${{ matrix.target }}
292
293 - name: Cache cargo registry
294 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
295 with:
296 path: |
297 ~/.cargo/registry
298 ~/.cargo/git
299 key: tests-mysql-${{ matrix.rust }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.toml') }}
300
301 - uses: davidB/rust-cargo-make@291dc18d931d07d4960a5c40e9b6afcea9287f5b # v1.15.0
302
303 - name: Run database tests
304 run: cargo make test-db-mysql-all
305
306 wasm_tests:
307 name: "WASM Tests"
308 runs-on: ubuntu-latest
309 steps:
310 - uses: actions/checkout@v4
311
312 - uses: dtolnay/rust-toolchain@stable
313 with:
314 toolchain: stable
315 targets: wasm32-unknown-unknown
316 components: clippy
317
318 - name: Cache cargo registry
319 uses: actions/cache@v4
320 with:
321 path: |
322 ~/.cargo/registry
323 ~/.cargo/git
324 key: tests-wasm-stable-cargo-${{ hashFiles('**/Cargo.toml') }}
325 restore-keys: |
326 tests-wasm-stable-cargo-
327
328 - name: Install wasm-pack
329 run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
330
331 - name: Check wasm build
332 run: cargo check --target wasm32-unknown-unknown --features wasm
333
334 - name: Run clippy for wasm
335 run: cargo clippy --target wasm32-unknown-unknown --features wasm
336
337 - name: Run wasm tests
338 run: wasm-pack test --node --features wasm
339
340 fuzz_tests:
341 name: Fuzz Tests
342 runs-on: ubuntu-latest
343 steps:
344 - name: Checkout repository
345 uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
346
347 - name: Install Rust toolchain
348 uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
349 with:
350 toolchain: nightly
351
352 - name: Cache cargo registry
353 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
354 with:
355 path: |
356 ~/.cargo/registry
357 ~/.cargo/git
358 key: tests-fuzz-${{ matrix.rust }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.toml') }}
359
360 - name: Install Cargo Fuzz
361 run: cargo install cargo-fuzz
362
363 - uses: davidB/rust-cargo-make@291dc18d931d07d4960a5c40e9b6afcea9287f5b # v1.15.0
364
365 - name: Run fuzz tests
366 run: cargo make fuzz