-
Notifications
You must be signed in to change notification settings - Fork 2
193 lines (191 loc) · 6.57 KB
/
Copy pathci.yml
File metadata and controls
193 lines (191 loc) · 6.57 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
# CI runs when a PR is opened/ready or before merging.
#
# | Event | When |
# |---------------------------------|----------------------------|
# | pull_request (opened) | PR created (draft or not) |
# | pull_request (ready_for_review) | Draft PR marked ready |
# | merge_group | Merge queue (before merge) |
# | workflow_dispatch | Manual trigger |
#
# Note: `synchronize` is intentionally omitted to avoid workflow runs on
# every push.
name: ci
on:
pull_request:
types: [opened, ready_for_review]
branches:
- main
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt:
name: nightly / fmt
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Install nightly
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # branch=master
id: toolchain
with:
toolchain: nightly
components: rustfmt
- name: Toolchain override
run: rustup override set "${TOOLCHAIN}"
env:
TOOLCHAIN: ${{steps.toolchain.outputs.name}}
- name: cargo fmt --all --check
run: cargo fmt --all --check
lint:
name: nightly / clippy, test and docs
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Setup Rust build environment
uses: ./.github/actions/setup-rust-build
with:
toolchain: nightly
components: clippy
shared-key: lint-all-features
- name: cargo clippy
run: cargo clippy --locked --all-targets --all-features -- -D warnings
- name: Install cargo-hack
uses: taiki-e/install-action@b9c5db3aef04caffaf95a1d03931de10fb2a140f # tag: v2.65.1
with:
tool: cargo-hack
- name: cargo hack
run: cargo hack --feature-powerset check --locked
- name: cargo test
run: cargo test --locked --all-features
- name: Check Documentation
run: cargo doc --locked --no-deps --workspace --all-features --document-private-items
env:
RUSTDOCFLAGS: -D warnings
build:
name: stable / build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Setup Rust build environment
uses: ./.github/actions/setup-rust-build
with:
toolchain: stable
shared-key: build-release
- name: cargo build --release
run: cargo build --release --locked
msrv:
name: MSRV / 1.85.1
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Setup Rust build environment
uses: ./.github/actions/setup-rust-build
with:
toolchain: "1.85.1"
shared-key: msrv
- name: cargo check
run: cargo check --locked --all-targets --all-features
cargo-deny:
name: Check licenses & security
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Check licenses
uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # tag: v2.0.14
with:
command: check licenses
- name: Install cargo-audit
uses: taiki-e/install-action@b9c5db3aef04caffaf95a1d03931de10fb2a140f # tag: v2.65.1
with:
tool: cargo-audit
- name: cargo audit
run: cargo audit
machete:
name: Check unused dependencies
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Install cargo-machete
uses: taiki-e/install-action@b9c5db3aef04caffaf95a1d03931de10fb2a140f # tag: v2.65.1
with:
tool: cargo-machete
- name: cargo machete
run: cargo machete
toml-fmt:
name: toml fmt
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Install taplo
uses: taiki-e/install-action@b9c5db3aef04caffaf95a1d03931de10fb2a140f # tag: v2.65.1
with:
tool: taplo
- name: taplo fmt --check
run: taplo fmt --check
markdown-lint:
name: markdown lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@07035fd053f7be764496c0f8d8f9f41f98305101 # tag: v22.0.0
yaml-lint:
name: yaml lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Lint YAML
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # tag: v3.1.1
typos:
name: typos
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Check typos
uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06 # tag: v1.40.0
docs-build:
name: docs / mdbook build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1
- name: Setup Rust build environment
uses: ./.github/actions/setup-rust-build
with:
toolchain: stable
shared-key: docs-mdbook
- name: Install cargo-binstall
uses: taiki-e/install-action@b9c5db3aef04caffaf95a1d03931de10fb2a140f # tag: v2.65.1
with:
tool: cargo-binstall
- name: Install mdbook and plugins
run: |
cargo binstall -y 'mdbook@0.4.52' || cargo install --locked mdbook --version 0.4.52
cargo binstall -y mdbook-katex mdbook-admonish || cargo install --locked mdbook-katex mdbook-admonish
- name: mdbook build
run: mdbook build docs