-
Notifications
You must be signed in to change notification settings - Fork 38
75 lines (59 loc) · 1.79 KB
/
Copy pathrust.yml
File metadata and controls
75 lines (59 loc) · 1.79 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
name: Rust CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
COVERAGE_THRESHOLD: "80"
jobs:
lint:
name: Format & Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (rustfmt + clippy)
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
targets: wasm32-unknown-unknown
- name: Cache cargo registry and build output
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy (deny warnings)
run: cargo clippy --all-targets --all-features -- -D warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: llvm-tools-preview
targets: wasm32-unknown-unknown
- name: Cache cargo registry and build output
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Enforce code coverage threshold
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --workspace \
--all-targets \
--locked \
--fail-under-lines "$COVERAGE_THRESHOLD" \
--summary-only
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.x'
- name: Run Storage Layout Collision Check
run: python scripts/storage-layout-check.py