name: wai-quantum-qpu # The clients for quantum processing services: every client against a service # that follows its provider's published contract (the fake parses the program # in the provider's format, runs it on wai-quantum's simulator, and answers in # the provider's result shape and bit order), certification through the # fabric, the probe that catches a service with another bit order, and curl # end to end against a local server. No request leaves the runner. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: push: branches: [main] paths: - 'wai/wai-quantum-qpu/**' - 'wai/wai-quantum/**' - 'rust-toolchain.toml' - '.github/workflows/wai-quantum-qpu.yml' pull_request: paths: - 'wai/wai-quantum-qpu/**' - 'wai/wai-quantum/**' - 'rust-toolchain.toml' - '.github/workflows/wai-quantum-qpu.yml' jobs: # Does this pull request's own diff touch the paths below? This forge matches a # workflow's `paths:` against the push, so a merge of main into a branch fires the # workflow whatever the pull request changes; every job here waits on this answer. # A push to main, a schedule, or anything the script cannot determine answers # `true` (scripts/pr-touches-paths.py). 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-qpu.yml \ "${{ github.event.pull_request.base.sha }}" \ "${{ github.event.pull_request.head.sha }}") echo "this change touches wai-quantum-qpu: $r" echo "run=$r" >> "$GITHUB_OUTPUT" clients: name: clients against their contracts (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 shell: bash working-directory: wai/wai-quantum-qpu run: | set -euo pipefail command -v curl >/dev/null || { echo "::error::no curl: the transport test would pass over nothing"; exit 1; } cargo test --locked 2>&1 | tee "$RUNNER_TEMP/test.log" grep -qE '^test result: ok\. 8 passed; 0 failed' "$RUNNER_TEMP/test.log" || { echo "::error::not every client test ran and passed"; exit 1; } grep -q '^test curl_carries_a_request_to_a_server_and_back \.\.\. ok$' "$RUNNER_TEMP/test.log" || { echo "::error::the transport test did not run"; exit 1; } - name: Clippy shell: bash working-directory: wai/wai-quantum-qpu run: cargo clippy --locked --all-targets --no-deps -- -D warnings