name: wai-sink-swift native sink package # The native sink's Swift package (wai/wai-sink-swift, extensions/native-sink.md): on the macOS # runner, the host with the platform SDKs and simulators, libwai is built for every slice of the # package's binary target (desktop, phone, phone simulator, television, television simulator) and # the package's tests run on the desktop, and in fresh phone and television simulators hosted in # TestHost (a device runs no tool-hosted test bundle), every step bounded: the corpus # live-conformance/native-sink through the Swift wrapper and the C interface; the loopback relay # over the reference package's floor, presenting what verifies byte for byte and answering 502 # for a fragment changed at the origin; and the platform's player end to end, over a presentation # made at run time with the platform's own encoder, played through the relay to its end, a changed # fragment withheld, and a session nobody can see ended as hidden. The phone and television device # slices are built and linked, not run. Nothing listens beyond loopback. # # 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-sink-swift/**' - 'wai/wai-rs/**' - 'wai/wai-quantum/**' - 'wai/wai-ops/**' - 'wai/live-conformance/native-sink/**' - 'wai/pack-conformance/packs/video-base-01/**' - 'wai/extensions/native-sink.md' - 'rust-toolchain.toml' - '.github/workflows/wai-sink-swift.yml' pull_request: paths: - 'wai/wai-sink-swift/**' - 'wai/wai-rs/**' - 'wai/wai-quantum/**' - 'wai/wai-ops/**' - 'wai/live-conformance/native-sink/**' - 'wai/pack-conformance/packs/video-base-01/**' - 'wai/extensions/native-sink.md' - 'rust-toolchain.toml' - '.github/workflows/wai-sink-swift.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-sink-swift.yml \ "${{ github.event.pull_request.base.sha }}" \ "${{ github.event.pull_request.head.sha }}") echo "this change touches wai-sink-swift: $r" echo "run=$r" >> "$GITHUB_OUTPUT" package-macos: name: libwai slices, desktop tests, simulator tests ยท 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" - name: The targets the slices need shell: bash run: | set -euo pipefail rustup target add aarch64-apple-darwin x86_64-apple-darwin aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios rustup component list --toolchain nightly-2026-10-17 --installed | grep -q '^rust-src' \ || rustup toolchain install nightly-2026-10-17 --profile minimal --component rust-src - name: WaiFFI.xcframework, every slice shell: bash working-directory: wai/wai-sink-swift run: nice -n 10 bash scripts/build-xcframework.sh - name: The desktop tests shell: bash working-directory: wai/wai-sink-swift timeout-minutes: 20 run: | set -euo pipefail nice -n 10 swift test 2>&1 | tee "$RUNNER_TEMP/swift-test.log" grep -qE "Executed [1-9][0-9]* tests, with 0 failures" "$RUNNER_TEMP/swift-test.log" || { echo "::error::the desktop tests did not pass"; exit 1; } # Each simulator run creates and boots a fresh simulator, builds the test host for it and runs # the tests hosted in it, then shuts the simulator down and deletes it, however the run ends. # Every step inside has a hard limit and fails, saying which, when it passes it; the step's # own limit is the backstop, so no run holds the runner past it. - name: The phone simulator tests, hosted in TestHost shell: bash working-directory: wai/wai-sink-swift timeout-minutes: 30 run: nice -n 10 bash scripts/test-simulator.sh ios - name: The television simulator tests, hosted in TestHost shell: bash working-directory: wai/wai-sink-swift timeout-minutes: 30 run: nice -n 10 bash scripts/test-simulator.sh tvos - name: The phone and television device slices link shell: bash working-directory: wai/wai-sink-swift timeout-minutes: 20 run: | set -euo pipefail for d in "generic/platform=iOS" "generic/platform=tvOS"; do xcodebuild build -scheme WaiSink -destination "$d" -derivedDataPath .build/xc-device 2>&1 | tee "$RUNNER_TEMP/device.log" | grep -E "error:|\*\* BUILD" || true grep -q '\*\* BUILD SUCCEEDED \*\*' "$RUNNER_TEMP/device.log" || { echo "::error::the package does not build for $d"; exit 1; } done