-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (115 loc) · 4.99 KB
/
Copy pathci.yaml
File metadata and controls
149 lines (115 loc) · 4.99 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
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
baseline:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Validate initial publication guards and Cargo license assets
run: |
node --test scripts/initial-publish-context.test.mjs scripts/cargo-publish-context.test.mjs
node scripts/cargo-package-assets.mjs --check
- name: Read supported specification revision
id: specification
shell: bash
run: |
grep -Eq '^[0-9a-f]{40}$' tests/specification-revision
revision=$(tr -d '\n' < tests/specification-revision)
printf 'revision=%s\n' "$revision" >> "$GITHUB_OUTPUT"
- name: Check out canonical specification
uses: actions/checkout@v7
with:
repository: stack-sh/specification
ref: ${{ steps.specification.outputs.revision }}
path: .stack-specification
- name: Install latest stable Rust toolchain
run: rustup toolchain install stable --profile minimal --component clippy,rustfmt,llvm-tools-preview
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 20
cache: npm
- name: Install JavaScript development dependencies
run: npm ci
- name: Validate layout corpus contract
run: npm run layout:validate
- name: Install WebAssembly binding generator
uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: wasm-bindgen-cli@0.2.127
fallback: none
- name: Check formatting
run: cargo +stable fmt --check
- name: Run tests
run: cargo +stable test --workspace --locked
- name: Run canonical formatter suite
env:
STACK_SPECIFICATION_DIR: ${{ github.workspace }}/.stack-specification
run: cargo +stable test -p stack-formatter --features conformance --test conformance --locked
- name: Run canonical scene suite
env:
STACK_SPECIFICATION_DIR: ${{ github.workspace }}/.stack-specification
run: cargo +stable test -p stack-engine --features conformance --locked
- name: Validate standalone SVG snapshots
run: python3 scripts/validate-svg.py
- name: Enforce layout runtime budget
run: cargo +stable test --release -p stack-engine --test layout_corpus layout_runtime_stays_within_budget --locked -- --ignored --nocapture
- name: Enforce editor language-intelligence latency budget
run: cargo +stable test --release -p stack-engine --test language_intelligence language_intelligence_runtime_stays_within_budget --locked -- --ignored --nocapture
- name: Build layout regression gallery
run: npm run layout:gallery
- name: Build browser WebAssembly package
run: |
rustup target add wasm32-unknown-unknown wasm32-wasip1 --toolchain stable
npm run build:wasm
- name: Test native and browser operation parity
run: npm test
- name: Check browser package types
run: npm run typecheck
- name: Verify browser package contents
run: npm run pack:check
- name: Install WebAssembly test runtime
uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: wasmtime@48.0.1
fallback: none
- name: Verify native and WebAssembly geometry parity
env:
CARGO_TARGET_WASM32_WASIP1_RUNNER: wasmtime
run: cargo +stable test -p stack-engine --lib --target wasm32-wasip1 cross_target_numeric_fixture --locked
- name: Verify registry-ready formatter package
run: cargo +stable publish --dry-run -p stack-formatter --locked
- name: Run Clippy
run: cargo +stable clippy --workspace --all-targets --all-features --locked -- -D warnings
- name: Build documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo +stable doc --workspace --no-deps --locked
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: cargo-llvm-cov@0.9.0
fallback: none
- name: Enforce unit-test coverage
env:
STACK_SPECIFICATION_DIR: ${{ github.workspace }}/.stack-specification
run: cargo +stable llvm-cov --lib --workspace --all-features --locked --fail-under-lines 95 --fail-under-functions 95 --fail-under-regions 95
msrv:
name: Minimum supported Rust
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Install Rust 1.85
run: rustup toolchain install 1.85.0 --profile minimal --component clippy
- name: Run tests
run: cargo +1.85.0 test --workspace --locked
- name: Run Clippy
run: cargo +1.85.0 clippy --workspace --all-targets --all-features --locked -- -D warnings