open-standards/.github/workflows/wai-quantum-studio.yml
Transaction Science d48cc8c510 wai-quantum-desktop: device targets for the Studio
Three commands, targets, target and target_place, answer the Studio's
device pane with the built-in targets and the person's own (kept with
wai-quantum targets import, read through wai_quantum_cli::target_store), and
a job naming a kept target carries its document to the worker. CI checks the
new test by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 23:44:27 -04:00

146 lines
5.9 KiB
YAML

name: wai-quantum studio and desktop
# Quantum Studio (wai/quantum-studio), the interface for the browser and the
# desktop, and the desktop app around it (wai/wai-quantum-desktop):
# - the Studio built against the engine's browser package (wai-web, feature
# quantum_engine) and run in a browser by test/studio.test.mjs: linted, drawn and
# planned as it is typed, run here with its receipt checked here, an error marked
# on its line, any angle on the state vector, Ctrl+Enter, and the program and the
# history kept across a reload; a device target's coupling map coloured by its
# errors, a run placed and simulated on it, and the layout drawn on the map;
# nothing scrolls sideways at a phone's width;
# - test/hardware.test.mjs, without a browser: "Your hardware" asks the person before
# a run that is not free, never before a free one, and sends nothing on a "no";
# - the desktop app's tests and clippy with warnings as errors, and `check`: a job
# run in the app's worker process, sealed in the app with a key that never leaves
# it, and verified, with no window.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
paths:
- 'wai/quantum-studio/**'
- 'wai/wai-quantum-desktop/**'
- 'wai/wai-quantum/**'
- 'wai/wai-quantum-cli/**'
- 'wai/wai-quantum-qpu/**'
- 'wai/wai-web/**'
- 'wai/wai-rs/**'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-studio.yml'
pull_request:
paths:
- 'wai/quantum-studio/**'
- 'wai/wai-quantum-desktop/**'
- 'wai/wai-quantum/**'
- 'wai/wai-quantum-cli/**'
- 'wai/wai-quantum-qpu/**'
- 'wai/wai-web/**'
- 'wai/wai-rs/**'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-studio.yml'
jobs:
relevant:
name: does this change touch it
runs-on: linux-arm64
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-quantum-studio.yml \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}")
echo "this change touches the studio or the desktop app: $r"
echo "run=$r" >> "$GITHUB_OUTPUT"
studio:
name: studio · browser
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 with the wasm32 target
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
rustup default 1.98.0
rustup target add wasm32-unknown-unknown
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
# Pinned to the wasm-bindgen version in wai-web/Cargo.lock.
- name: wasm-bindgen CLI 0.2.127
shell: bash
run: cargo install --locked wasm-bindgen-cli --version 0.2.127
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: The engine's browser package
shell: bash
working-directory: wai/wai-web
run: |
set -euo pipefail
cargo build --locked --release --target wasm32-unknown-unknown --features quantum_engine
wasm-bindgen --target web --out-dir "$RUNNER_TEMP/pkg" --out-name wai_quantum_ide \
target/wasm32-unknown-unknown/release/wai_web.wasm
- name: Build the Studio and run it in a browser
shell: bash
working-directory: wai/quantum-studio
env:
WAI_E2E_CHANNEL: ''
STUDIO_SKIP_SERVICE: '1'
run: |
set -euo pipefail
npm ci --no-audit --no-fund
npx playwright install --with-deps chromium
node test/hardware.test.mjs
node build.mjs --pkg "$RUNNER_TEMP/pkg"
node test/studio.test.mjs
desktop:
name: desktop app · 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 and node on the macOS host runner.
- name: Put cargo and node on PATH
shell: bash
run: |
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
echo "/opt/homebrew/bin" >> "$GITHUB_PATH"
# The app embeds the Studio's build, so it is built first.
- name: Build the Studio
shell: bash
working-directory: wai/quantum-studio
run: |
set -euo pipefail
npm ci --no-audit --no-fund
node build.mjs
- name: Tests, clippy, and a job through the worker with no window
shell: bash
working-directory: wai/wai-quantum-desktop
run: |
set -euo pipefail
nice -n 10 cargo test --locked --release 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; }
grep -q '^test tests::a_run_on_a_provider_is_estimated_refused_until_confirmed_and_sealed_with_the_app_s_key \.\.\. ok$' "$RUNNER_TEMP/test.log" || { echo "::error::the provider run test did not run and pass"; exit 1; }
grep -q '^test tests::device_targets_are_listed_shown_and_placed_for_the_page \.\.\. ok$' "$RUNNER_TEMP/test.log" || { echo "::error::the device targets test did not run and pass"; exit 1; }
nice -n 10 cargo clippy --locked --release --all-targets -- -D warnings
nice -n 10 cargo build --locked --release
./target/release/wai-quantum-desktop check