- runtime.mjs gives every runtime file a unique served name (wai-ui-<name>, wai-ui-room-<name>.js, wai_ui_room_moq, wai_ui_room_live): the WAI site fingerprints assets keyed by basename, and an export's vendor/ carries the same layout; - a room widget takes the room service for its kind (data-service-live, -watch, -show) when the page names one; - WAI's value rules (a poll's options and seconds, a show's audience, a watch room's source) wait for a pending statement to complete, as the line language's own errors do: a poll's `seconds` reads 2 before 20, and the poll no longer leaves the page for that chunk (found by the end-to-end run; a unit test now streams every recording a character at a time and requires that no widget, once shown, goes); - .github/workflows/wai-ui.yml: tests, clippy and the wasm32 surface, the line language's verifier and its mutations, the page modules (linux); Create in the browser (macos); - the e2e drives a WAI site build with --site; - wai-ui cites joule-ui's spec by its file (joule-ui/SPEC.md §N). Co-Authored-By: Claude Opus 5.5 <[email protected]>
150 lines
6.4 KiB
YAML
150 lines
6.4 KiB
YAML
name: wai-ui and Create
|
|
|
|
# WAI's widgets for joule-ui and Create (wai/wai-ui), and the line language they take a
|
|
# program in (joule-ui SPEC §11):
|
|
#
|
|
# unit wai-ui's tests (its registry, its rules, the guide, the export writer, the MCP
|
|
# server, and the binary driven over stdio by a client), clippy with warnings as
|
|
# errors, its WebAssembly surface checked for wasm32; the line language's
|
|
# independent verifier over the conformance pack, and its mutations refused; the
|
|
# page modules' unit tests (the renderer, the ZIP writer, the model streams);
|
|
# e2e Create in the host's browser (wai/wai-ui/e2e/run.sh): a recorded stream renders
|
|
# as it arrives, the room joins a real room service, a chat and a poll go through
|
|
# it, the page's sealed log verifies, the export builds and runs against the same
|
|
# room, the refused lines never render, and the export's own development setup
|
|
# brings its relay and room service up.
|
|
#
|
|
# The line language's own tests and its pack test run in standards-build (joule-ui-rs).
|
|
#
|
|
# Push filters match the push's delta, so every path the jobs read is listed.
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'wai/wai-ui/**'
|
|
- 'joule-ui/**'
|
|
- 'wai/wai-live-web/**'
|
|
- 'wai/wai-rs/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq-web/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq-relay/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq-room/**'
|
|
- 'joule-code/joule-code-rs/crates/jwp/**'
|
|
- 'joule-code/joule-code-rs/Cargo.toml'
|
|
- 'joule-code/joule-code-rs/Cargo.lock'
|
|
- 'rust-toolchain.toml'
|
|
- '.github/workflows/wai-ui.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'wai/wai-ui/**'
|
|
- 'joule-ui/**'
|
|
- 'wai/wai-live-web/**'
|
|
- 'wai/wai-rs/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq-web/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq-relay/**'
|
|
- 'joule-code/joule-code-rs/crates/joule-moq-room/**'
|
|
- 'joule-code/joule-code-rs/crates/jwp/**'
|
|
- 'joule-code/joule-code-rs/Cargo.toml'
|
|
- 'joule-code/joule-code-rs/Cargo.lock'
|
|
- 'rust-toolchain.toml'
|
|
- '.github/workflows/wai-ui.yml'
|
|
|
|
jobs:
|
|
# Forgejo matches `paths:` against the push delta, so a rebase fires this workflow
|
|
# whatever the pull request changes. This job reads the pull request's own diff against
|
|
# the paths above (scripts/pr-touches-paths.py, which fails open).
|
|
relevant:
|
|
name: wai-ui · does this change touch it
|
|
runs-on: linux
|
|
outputs:
|
|
run: ${{ steps.gate.outputs.run }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- id: gate
|
|
run: |
|
|
set -euo pipefail
|
|
r=$(python3 scripts/pr-touches-paths.py .github/workflows/wai-ui.yml \
|
|
"${{ github.event.pull_request.base.sha }}" \
|
|
"${{ github.event.pull_request.head.sha }}")
|
|
echo "this change touches wai-ui: $r"
|
|
echo "run=$r" >> "$GITHUB_OUTPUT"
|
|
|
|
# Nothing here needs macOS: it runs on the linux runner, leaving the macOS host to the
|
|
# browser job.
|
|
unit:
|
|
name: wai-ui · tests, clippy, the line language's verifier (linux)
|
|
needs: relevant
|
|
if: needs.relevant.outputs.run == 'true'
|
|
runs-on: linux
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Install Rust 1.98.0
|
|
shell: bash
|
|
run: |
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
command -v rustup >/dev/null 2>&1 || \
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.98.0
|
|
rustup toolchain install 1.98.0 --profile minimal --component clippy
|
|
rustup default 1.98.0
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
- name: Tests and clippy
|
|
shell: bash
|
|
working-directory: wai/wai-ui
|
|
run: |
|
|
set -euo pipefail
|
|
rustup target add wasm32-unknown-unknown
|
|
nice -n 10 cargo test --locked 2>&1 | tee "$RUNNER_TEMP/test.log"
|
|
grep -qE '^test result: ok\. [1-9][0-9]* passed; 0 failed' "$RUNNER_TEMP/test.log" || { echo "::error::no test ran"; exit 1; }
|
|
nice -n 10 cargo clippy --locked --all-targets -- -D warnings
|
|
nice -n 10 cargo clippy --locked --lib --target wasm32-unknown-unknown --no-default-features --features web -- -D warnings
|
|
- name: The line language's independent verifier, and its mutations
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
python3 -I joule-ui/conformance/lang_verify.py
|
|
python3 -I joule-ui/conformance/lang_verify.py --mutations
|
|
- name: The page modules
|
|
shell: bash
|
|
run: node --test wai/wai-ui/web/web.test.mjs
|
|
|
|
e2e:
|
|
name: wai-ui · Create, browser end-to-end (macos)
|
|
needs: relevant
|
|
if: needs.relevant.outputs.run == 'true'
|
|
runs-on: macos
|
|
timeout-minutes: 90
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
# launchd's PATH omits cargo on the macOS host runner.
|
|
- name: Put cargo on PATH
|
|
shell: bash
|
|
run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
# Pinned to the wasm-bindgen the crates pin: the CLI and the crate must match.
|
|
- name: wasm32 target and wasm-bindgen CLI 0.2.127
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
rustup target add wasm32-unknown-unknown
|
|
cargo install --locked wasm-bindgen-cli --version 0.2.127
|
|
- name: Create in the browser
|
|
shell: bash
|
|
env:
|
|
BROWSER_BIN: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome # allow-name: the macOS runner's browser executable, a file path
|
|
CREATE_E2E_OUT: ${{ runner.temp }}/wai-create
|
|
run: |
|
|
set -euo pipefail
|
|
test -x "$BROWSER_BIN" || { echo "::error::this runner has no browser at $BROWSER_BIN"; exit 1; }
|
|
mg=/Volumes/macos_4TB_external_1/wai-build/bin/memguard
|
|
if [ -x "$mg" ]; then export MEMGUARD="$mg"; fi
|
|
nice -n 10 bash wai/wai-ui/e2e/run.sh 2>&1 | tee "$RUNNER_TEMP/create-e2e.log"
|
|
grep -qE '^create e2e: [1-9][0-9]* passed, 0 failed$' "$RUNNER_TEMP/create-e2e.log" \
|
|
|| { echo "::error::the Create end-to-end run did not pass"; exit 1; }
|