Repository navigation
329 lines (264 loc) · 9.4 KB
/
Copy pathci.yml
File metadata and controls
329 lines (264 loc) · 9.4 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
name: CI
# Pull requests are validated here. Releases are validated locally, so branch
# and tag pushes must not start hosted CI.
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_VERSION: "1.97.0"
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- name: Check repository release invariants
shell: bash
run: |
while read -r action; do
[[ "$action" == ./* ]] && continue
revision="${action##*@}"
if [[ ! "$revision" =~ ^[0-9a-f]{40}$ ]]; then
echo "GitHub Action is not pinned to a full commit SHA: $action" >&2
exit 1
fi
done < <(awk '/^[[:space:]]*uses:/ { print $2 }' .github/workflows/ci.yml)
if git check-ignore --quiet --no-index crates/example/src/debug/mod.rs; then
echo "Nested source directory named debug must not be ignored" >&2
exit 1
fi
git check-ignore --quiet --no-index .claude/worktrees/example
if grep --quiet '^serde-wasm-bindgen[[:space:]]*=' crates/lsp/Cargo.toml; then
echo "solcore-lsp must not expose its removed dead dependency" >&2
exit 1
fi
- name: Check formatting
run: cargo fmt --all -- --check
check:
name: Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Check workspace
run: cargo check --workspace --all-targets --all-features --locked
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Lint workspace
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
wasm-build:
name: Wasm build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
targets: wasm32-unknown-unknown
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Install Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: npm
cache-dependency-path: |
playground/package-lock.json
editors/vscode-solcore/package-lock.json
- name: Install wasm-pack
run: cargo install wasm-pack --version 0.15.0 --locked
- name: Install tutorial builder
run: cargo install mdbook --version 0.4.52 --locked
- name: Install playground dependencies
working-directory: playground
run: npm ci
- name: Test playground JavaScript
working-directory: playground
run: npm run test:unit
- name: Build release playground
working-directory: playground
run: npm run build
- name: Test and build standalone tutorial
working-directory: solcore-tutorial
run: |
npm test
npm run build:book
npm run test:bundle
npm run test:wasm
- name: Test playground WASM execution
working-directory: playground
run: npm run test:wasm
- name: Validate VS Code extension package
working-directory: editors/vscode-solcore
run: |
npm ci
npm run test:unit
node --check extension.js
npm pack --dry-run
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Run tests
run: cargo test --workspace --all-features --locked
platform-test:
name: Platform tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Run path and editor integration tests
run: >-
cargo test --all-features --locked
-p solcore-parser
-p solcore-nameres
-p solcore-vfs
-p solcore-lsp
-p solcore-driver
performance:
name: Performance pathology guard
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Run scaling workloads with generous ceilings
run: scripts/check-compile-performance.sh
e2e:
name: E2E
runs-on: ubuntu-latest
timeout-minutes: 45
env:
E2E: "1"
E2E_REQUIRED: "1"
ANVIL_HARDFORK: "osaka"
# Published in https://binaries.soliditylang.org/linux-amd64/list.json.
SOLC_SHA256: fa8ac9a32d301ad023a36ee5a29f8e291fe3200c60244e43c142539e82a617f4
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@b00af27efadbc7b4ca8b82abbd903b17cc874d2a # v1.9.0
with:
version: v1.7.1
- name: Configure solc path
run: echo "SOLC=$RUNNER_TEMP/solc" >> "$GITHUB_ENV"
- name: Install solc
run: |
curl --fail --location --retry 3 \
--output "$SOLC" \
https://github.com/ethereum/solidity/releases/download/v0.8.35/solc-static-linux
echo "$SOLC_SHA256 $SOLC" | sha256sum --check --strict
chmod +x "$SOLC"
- name: Show tool versions
run: |
"$SOLC" --version
anvil --version
cast --version
- name: Compile Yul regression corpus with solc
run: >-
cargo test --profile e2e -p solcore-yul --test snapshots --locked
solc_strict_assembly_compiles_snapshots_and_repros_when_present --
--nocapture
- name: Run E2E tests
run: >-
cargo test --profile e2e -p solcore-yul -p solcore-sonatina
--test e2e --locked -- --nocapture --test-threads=1
- name: Test playground execution through solc
env:
SOLCORE_WASM_TEST_BACKEND: solc
run: cargo test --profile e2e -p solcore-wasm --locked
docs:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 20
env:
RUSTDOCFLAGS: -D warnings
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Build documentation
run: cargo doc --workspace --all-features --no-deps --locked