-
Notifications
You must be signed in to change notification settings - Fork 350
229 lines (215 loc) · 7.5 KB
/
Copy pathlint.yml
File metadata and controls
229 lines (215 loc) · 7.5 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
name: Lint
permissions: {}
on:
push:
branches: [main]
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"
jobs:
clippy:
name: clippy
runs-on: depot-ubuntu-latest-32
timeout-minutes: 45
env:
CARGO_BUILD_JOBS: 4
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@7c8d7d138f5c09cef361f8214cf96882cd029cdb # nightly
with:
toolchain: nightly-2026-08-21
components: clippy
- uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
version: v0.15.0
- name: Run clippy on runtime targets
run: cargo clippy --workspace --lib --bins --all-features --locked
env:
RUSTFLAGS: -D warnings
- name: Run clippy on test targets
run: cargo clippy --workspace --tests --all-features --locked
env:
RUSTFLAGS: -D warnings
- name: Run clippy on bench and example targets
run: cargo clippy --workspace --benches --examples --all-features --locked
env:
RUSTFLAGS: -D warnings
fmt:
name: fmt
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@7c8d7d138f5c09cef361f8214cf96882cd029cdb # nightly
with:
components: rustfmt
- run: cargo fmt --all --check
crate-checks:
runs-on: depot-ubuntu-latest-4
timeout-minutes: 60
if: github.event_name == 'push'
permissions:
contents: read
strategy:
fail-fast: false
matrix:
partition: [1, 2]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
- uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
version: v0.15.0
- uses: taiki-e/install-action@d0f23220b09a75c6db730f13bb37c4f8144b4382 # v2.75.9
with:
tool: cargo-hack
- run: cargo hack check --feature-powerset --depth 1 --partition ${{ matrix.partition }}/2
docs:
if: ${{ github.repository == 'tempoxyz/tempo' }}
name: docs
runs-on: depot-ubuntu-latest-32
timeout-minutes: 30
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@7c8d7d138f5c09cef361f8214cf96882cd029cdb # nightly
- uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
version: v0.15.0
- name: Build documentation
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options
- name: Exclude rustdocs from indexing
if: github.ref_name == 'main' && github.event_name == 'push'
run: |
{
echo "User-agent: *"
echo "Disallow: /"
} > target/doc/robots.txt
- name: Setup Pages
if: github.ref_name == 'main' && github.event_name == 'push'
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
with:
enablement: true
- name: Upload artifact
if: github.ref_name == 'main' && github.event_name == 'push'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: ./target/doc
deploy-docs:
if: ${{ github.repository == 'tempoxyz/tempo' && github.ref_name == 'main' && github.event_name == 'push' }}
needs: [docs]
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
typos:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: crate-ci/typos@02ea592e44b3a53c302f697cddca7641cd051c3d # v1.45.0
deny:
permissions:
contents: read
uses: tempoxyz/ci/.github/workflows/deny.yml@09f481293feb726bcd5c94853063b224a9b2ff24 # main
zepter:
name: zepter
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
- uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
version: v0.15.0
- uses: taiki-e/cache-cargo-install-action@f9eed3e4680f27610dc6d8c67be1b88593f7dade # v3.0.6
with:
tool: zepter
- name: Eagerly pull dependencies
run: cargo metadata --format-version=1 --locked > /dev/null
- run: zepter run check
no-std:
name: no-std
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
with:
target: riscv32imac-unknown-none-elf
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
version: v0.15.0
- name: Install RISC-V C toolchain
run: sudo apt-get update && sudo apt-get install -y gcc-riscv64-unknown-elf
- name: Run no_std checks
run: .github/scripts/check_no_std.sh
env:
CC_riscv32imac_unknown_none_elf: riscv64-unknown-elf-gcc
lint-success:
name: lint success
runs-on: ubuntu-latest
if: always()
permissions: {}
needs:
- clippy
- fmt
- docs
- typos
- deny
- zepter
- no-std
timeout-minutes: 30
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
allowed-skips: ${{ github.repository != 'tempoxyz/tempo' && 'docs' || '' }}
jobs: ${{ toJSON(needs) }}