-
Notifications
You must be signed in to change notification settings - Fork 0
196 lines (186 loc) · 7.08 KB
/
Copy pathci.yml
File metadata and controls
196 lines (186 loc) · 7.08 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
workflow_call:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
permissions:
contents: read
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: rustfmt
- run: cargo fmt --check
lint:
name: ESLint (e2e/)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
- run: npm ci
- run: npm run lint
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: clippy
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: clippy-
- id: clippy
# Steps with `id:` end up with `bash -e {0}` (no pipefail) on this runner,
# so `... | tee` would silently mask failures. Force pipefail on.
shell: bash --noprofile --norc -eo pipefail {0}
run: cargo clippy --workspace --all-targets -- -D warnings 2>&1 | tee /tmp/clippy.log
- name: Surface clippy failure
if: failure() && steps.clippy.conclusion == 'failure'
run: |
{
echo "## Clippy failed"
echo
echo '<details><summary>last 200 lines</summary>'
echo
echo '```'
tail -n 200 /tmp/clippy.log || echo "(no log captured)"
echo '```'
echo
echo '</details>'
} >> "$GITHUB_STEP_SUMMARY"
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: test-
- id: test
shell: bash --noprofile --norc -eo pipefail {0}
run: cargo test --workspace 2>&1 | tee /tmp/test.log
- name: Surface test failure
if: failure() && steps.test.conclusion == 'failure'
run: |
{
echo "## Tests failed"
echo
echo '<details><summary>last 300 lines</summary>'
echo
echo '```'
tail -n 300 /tmp/test.log || echo "(no log captured)"
echo '```'
echo
echo '</details>'
} >> "$GITHUB_STEP_SUMMARY"
wasm:
name: WASM Check
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: wasm32-unknown-unknown
components: clippy
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: wasm-${{ hashFiles('**/Cargo.lock') }}
restore-keys: wasm-
- run: cargo check --target wasm32-unknown-unknown --workspace --exclude willow-relay --exclude willow-worker --exclude willow-replay --exclude willow-storage --exclude willow-agent --exclude willow-feedback
- name: Clippy (wasm32, willow-web)
run: cargo clippy --target wasm32-unknown-unknown -p willow-web --all-targets -- -D warnings
browser:
name: Browser tests (wasm-pack + Firefox)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: wasm32-unknown-unknown
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: browser-${{ hashFiles('**/Cargo.lock') }}
restore-keys: browser-
- name: Install wasm-pack
uses: taiki-e/install-action@50b4a718b59c718df4ef27a3b445f86cd57b9f00 # v2.80.0
with:
tool: wasm-pack
- id: browser
# `bash -e {0}` (default) does NOT enable pipefail, so `wasm-pack ... | tee`
# would silently mask failures (tee always exits 0). Use an explicit shell
# invocation that turns pipefail on so the link/test exit code surfaces.
shell: bash --noprofile --norc -eo pipefail {0}
run: wasm-pack test --headless --firefox crates/web 2>&1 | tee /tmp/browser.log
- name: Surface browser-test failure
if: failure() && steps.browser.conclusion == 'failure'
run: |
{
echo "## Browser tests failed"
echo
echo '<details><summary>last 300 lines</summary>'
echo
echo '```'
tail -n 300 /tmp/browser.log || echo "(no log captured)"
echo '```'
echo
echo '</details>'
} >> "$GITHUB_STEP_SUMMARY"
audit:
name: cargo-audit
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Install cargo-audit
run: cargo install --locked --version 0.22.1 cargo-audit
# Known advisories are tracked in dedicated issues; fail only on new ones.
# When each issue is resolved, remove the matching --ignore entry.
- name: Run cargo audit
run: |
cargo audit \
--ignore RUSTSEC-2026-0097 `# rand unsoundness (#246)` \
--ignore RUSTSEC-2025-0141 `# bincode 1.x unmaintained (#247)` \
--ignore RUSTSEC-2024-0436 `# paste unmaintained, via leptos+iroh (#316)` \
--ignore RUSTSEC-2024-0370 `# proc-macro-error unmaintained, via iroh-blobs->genawaiter (#317)` \
--ignore RUSTSEC-2023-0089 `# atomic-polyfill unmaintained, via iroh->postcard->heapless (#318)` \
--ignore RUSTSEC-2026-0119 `# hickory-proto O(n^2) name compression, via iroh-relay (#508)` \
--ignore RUSTSEC-2026-0120 `# hickory-net NSEC3 unbounded loop, via iroh-relay (#509)`