57 lines
2.3 KiB
YAML
57 lines
2.3 KiB
YAML
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:
|
|
clients:
|
|
name: clients against their contracts (linux)
|
|
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
|