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
name: Build, Format and Test
on:
push:
branches:
pull_request:
branches:
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: # Test across specific Rust versions: MSRV, stable, and beta
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- uses: swatinem/rust-cache@v2
- name: Cargo Build
# --locked validates Cargo.lock is in sync and, on the MSRV toolchain,
# fails loudly if the lockfile is ever regenerated into a format 1.75
# can't parse (e.g. lockfile v4) instead of silently drifting.
run: cargo build --verbose --locked
- name: Cargo Test
run: cargo test --verbose --locked
- name: Cargo fmt
if: matrix.toolchain == 'stable' # Only run fmt on stable toolchain
run: cargo fmt --all -- --check
- name: Cargo Clippy
if: matrix.toolchain == 'stable' # Only run clippy on stable toolchain
run: cargo clippy -- -D warnings # Treat warnings as errors
corpus_freshness:
# Drift check between tests/all_cases.json and the JS SDK's cases.json.
# Fails the build on any "missing" or body-"drift" case not listed in
# tests/scripts/corpus_skiplist.json. Extras (Rust's local additions) are
# reported but never fail.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Check corpus freshness vs JS SDK
run: python3 tests/scripts/check_corpus_freshness.py