Skip to content

Reduce congestion in dense layouts #54

Reduce congestion in dense layouts

Reduce congestion in dense layouts #54

Workflow file for this run

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