-
Notifications
You must be signed in to change notification settings - Fork 4
94 lines (86 loc) · 2.44 KB
/
ci.yml
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
name: CI
on:
push:
branches-ignore:
- "gh-readonly-queue/**"
pull_request:
merge_group:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
check:
name: cargo check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
with:
toolchain: "1.70"
- run: cargo check --all-targets --all-features
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
with:
toolchain: "1.70"
components: rustfmt
- run: cargo fmt --all --check
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
with:
toolchain: "1.70"
- run: cargo test --all-targets --all-features
- run: cargo test --doc
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
with:
toolchain: "1.70"
components: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
clippy-latest:
name: cargo clippy latest
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
minimal-dependencies:
name: minimal direct dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- run: rm Cargo.lock
- run: cargo check -Z direct-minimal-versions --all-targets --all-features
# Job to key success status against
allgreen:
name: allgreen
if: always()
needs:
- check
- fmt
- test
- clippy
- minimal-dependencies
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}