Files
AniCraft/.github/workflows/web.yml
T
Dylan M. Taylor d78d8e9727 ci: run Harden-Runner on every job (#162)
Adds step-security/harden-runner (audit, pinned to v2.22.4 like
craft-common-actions) as the first step of each job that did not have it,
so every workflow in the org's public repos reports its egress to
StepSecurity. Audit, not block: block-mode allow lists come from each
job's observed traffic.
2026-11-11 12:08:43 -05:00

59 lines
2.0 KiB
YAML

# The web build (ADR 0036, docs/web.md), so it never regresses: every crate of the workspace
# builds for wasm32-unknown-unknown, the engine's tests/wasm.rs runs inside WebAssembly in Node
# (what a build can't catch: clock, thread and file calls that compile but trap), and
# scripts/build-web.sh produces the web/ bundle. Nothing is deployed.
name: Web
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
# A newer push to a PR branch cancels its older run; every push to main runs to the end.
concurrency:
group: web-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
wasm:
name: Web build (wasm32)
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CARGO_TERM_COLOR: always
steps:
- name: Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Rust with the wasm32 target
run: |
rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown
rustup default stable
- name: Every crate builds for wasm32
run: cargo build --workspace --target wasm32-unknown-unknown --locked
- name: wasm-bindgen CLI at the version Cargo.lock pins
run: |
version="$(awk '/^name = "wasm-bindgen"$/ { getline; gsub(/version = |"/, ""); print; exit }' Cargo.lock)"
cargo install wasm-bindgen-cli --version "$version" --locked
- name: The engine inside WebAssembly (Node)
env:
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: wasm-bindgen-test-runner
run: cargo test -p anicraft-engine --target wasm32-unknown-unknown --test wasm --locked
- name: The web editor bundle
run: |
scripts/build-web.sh
ls -l web