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; nothing scrolls sideways at a phone's width; # - 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-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-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 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; } nice -n 10 cargo clippy --locked --release --all-targets -- -D warnings nice -n 10 cargo build --locked --release ./target/release/wai-quantum-desktop check