Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

ci(verify): real capture on GitHub-hosted Windows in Verify recording

Richie McIlroyaf4d265a0271
diff --git a/.github/workflows/verify-recording-windows.yml b/.github/workflows/verify-recording-windows.yml
deleted file mode 100644
index 9e9051aec..000000000
--- a/.github/workflows/verify-recording-windows.yml
+++ /dev/null
@@ -1,101 +0,0 @@
-name: Verify recording (Windows, bring-up)
-
-# Bring-up of the real-capture oracle (crates/verify/tests/recording.rs) on
-# GitHub-hosted Windows: its jobs run in the runner's interactive console
-# session, where Windows Graphics Capture records the desktop. Blacksmith
-# Windows VMs run jobs in session 0, which has no desktop to capture
-# (probe runs 38997642473, 38997747111).
-
-on:
- push:
- branches: [ci/windows-real-capture]
- workflow_dispatch:
- inputs:
- tier:
- description: "fast or full"
- default: "fast"
- case_filter:
- description: "Case globs, comma-separated (empty runs all)"
- default: ""
-
-concurrency:
- group: verify-recording-windows-${{ github.ref_name }}
- cancel-in-progress: true
-
-permissions:
- contents: read
-
-jobs:
- real-capture:
- runs-on: windows-2022
- timeout-minutes: 90
- env:
- CAP_VERIFY_CAPTURE: display
- CAP_VERIFY_REQUIRE_CAPTURE: "1"
- CAP_VERIFY_TIER: ${{ inputs.tier || 'fast' }}
- CAP_VERIFY_CASE: ${{ inputs.case_filter || '' }}
- CAP_VERIFY_SCRATCH: ${{ github.workspace }}/verify-scratch
- CAP_VERIFY_REPORT_DIR: ${{ github.workspace }}/verify-report
- CAP_VERIFY_DUMP: ${{ github.workspace }}/verify-dump
- CAP_VERIFY_HOST: github-hosted
- # No audio endpoints on hosted Windows: nothing plays or loops back
- # system audio.
- CAP_VERIFY_STIMULUS_AUDIO: "0"
- steps:
- - uses: actions/checkout@v4
- with:
- persist-credentials: false
-
- - name: Setup
- id: setup
- uses: ./.github/actions/engine-verify-setup
- with:
- target: x86_64-pc-windows-msvc
- tier: fast
-
- - name: Build
- shell: bash
- run: |
- start=$(date +%s)
- cargo build --locked --profile ci-verify -p cap-verify-stimulus
- cargo test --locked --profile ci-verify -p cap-verify --test recording --no-run
- echo "build seconds: $(( $(date +%s) - start ))"
-
- - name: Save build cache
- if: steps.setup.outputs.build-cache-hit != 'true'
- uses: actions/cache/save@v4
- with:
- path: |
- ~/.cargo/registry/index/
- ~/.cargo/registry/cache/
- ~/.cargo/git/db/
- target/ci-verify/
- key: ${{ steps.setup.outputs.build-cache-key }}
-
- - name: Stimulus smoke
- continue-on-error: true
- shell: bash
- run: |
- spec='{"fps":15.0,"seconds":2.0,"holds":[],"busy":true,"audio":false,"warmup":1.0,"audio_period":0.5,"audio_origin":0,"window":null}'
- (sleep 5; echo go; sleep 4; echo quit) | target/ci-verify/cap-verify-stimulus.exe "$spec" "$RUNNER_TEMP/stimulus.jsonl"
- echo "exit status $?"
- head -c 3000 "$RUNNER_TEMP/stimulus.jsonl" || true
-
- - name: Real-capture recording oracle
- shell: bash
- run: cargo test --locked --profile ci-verify -p cap-verify --test recording -- --nocapture
-
- - name: Summary
- if: always()
- shell: bash
- run: python scripts/verify/summary.py --title "real capture windows-2022" "$CAP_VERIFY_REPORT_DIR" >> "$GITHUB_STEP_SUMMARY" || true
-
- - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
- if: always()
- with:
- name: verify-recording-windows-2022
- path: |
- ${{ github.workspace }}/verify-report
- ${{ github.workspace }}/verify-dump
- ${{ github.workspace }}/verify-scratch
- if-no-files-found: ignore
diff --git a/.github/workflows/verify-recording.yml b/.github/workflows/verify-recording.yml
index 28a0af887..7962dc209 100644
--- a/.github/workflows/verify-recording.yml
+++ b/.github/workflows/verify-recording.yml
@@ -1,8 +1,9 @@
name: Verify recording (real capture)
# Records a marker stimulus through Cap's real Studio and Instant pipelines
-# (ScreenCaptureKit + VideoToolbox) on macOS runners and checks every frame
-# and audio marker against the host-clock truth. See
+# on macOS (ScreenCaptureKit + VideoToolbox) and GitHub-hosted Windows
+# (Windows Graphics Capture + Media Foundation) and checks every frame and
+# audio marker against the host-clock truth. See
# crates/verify/tests/recording.rs.
#
# Every pull request gets a "Verify recording" verdict (the job to require):
@@ -328,11 +329,87 @@ jobs:
${{ github.workspace }}/verify-scratch
if-no-files-found: ignore
+ # GitHub-hosted Windows runs jobs in the runner's interactive console
+ # session, where Windows Graphics Capture records the desktop; Blacksmith
+ # Windows VMs run jobs in session 0, which has no desktop (probe runs
+ # 38997642473, 38997747111). Hosted Windows has no audio endpoints, so the
+ # stimulus stays silent and system audio is not recorded.
+ real-capture-windows:
+ name: real-capture (windows-2022)
+ needs: scope
+ if: needs.scope.outputs.run == 'true'
+ runs-on: windows-2022
+ timeout-minutes: 60
+ env:
+ CAP_VERIFY_CAPTURE: display
+ CAP_VERIFY_REQUIRE_CAPTURE: "1"
+ CAP_VERIFY_TIER: ${{ needs.scope.outputs.tier }}
+ CAP_VERIFY_REPEAT: ${{ inputs.repeat || (github.event_name == 'schedule' && '3') || '1' }}
+ CAP_VERIFY_CASE: ${{ inputs.case_filter || '' }}
+ CAP_VERIFY_KEEP: ${{ inputs.keep_artifacts && '1' || '' }}
+ CAP_VERIFY_SCRATCH: ${{ github.workspace }}/verify-scratch
+ CAP_VERIFY_REPORT_DIR: ${{ github.workspace }}/verify-report
+ CAP_VERIFY_DUMP: ${{ github.workspace }}/verify-dump
+ CAP_VERIFY_HOST: github-hosted
+ CAP_VERIFY_REQUIRE_SUPPORTED: "1"
+ CAP_VERIFY_UNSUPPORTED_ALLOW: recording/instant/system-only
+ CAP_VERIFY_STIMULUS_AUDIO: "0"
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Setup
+ id: setup
+ uses: ./.github/actions/engine-verify-setup
+ with:
+ target: x86_64-pc-windows-msvc
+ tier: fast
+
+ - name: Build
+ shell: bash
+ run: |
+ start=$(date +%s)
+ cargo build --locked --profile ci-verify -p cap-verify-stimulus
+ cargo test --locked --profile ci-verify -p cap-verify --test recording --no-run
+ echo "build seconds: $(( $(date +%s) - start ))"
+
+ - name: Save build cache
+ if: steps.setup.outputs.build-cache-hit != 'true'
+ uses: actions/cache/save@v4
+ with:
+ path: |
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ target/ci-verify/
+ key: ${{ steps.setup.outputs.build-cache-key }}
+
+ - name: Real-capture recording oracle
+ shell: bash
+ run: cargo test --locked --profile ci-verify -p cap-verify --test recording -- --nocapture
+
+ - name: Summary
+ if: always()
+ shell: bash
+ run: python scripts/verify/summary.py --title "real capture windows-2022 ${{ needs.scope.outputs.tier }}" "$CAP_VERIFY_REPORT_DIR" >> "$GITHUB_STEP_SUMMARY" || true
+
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: verify-recording-windows-2022
+ path: |
+ ${{ github.workspace }}/verify-report
+ ${{ github.workspace }}/verify-dump
+ ${{ github.workspace }}/verify-scratch
+ if-no-files-found: ignore
+
# The check to require: green when the change is out of scope or every
# planned runner passed with at least the tier's case count.
gate:
name: Verify recording
- needs: [scope, real-capture]
+ needs: [scope, real-capture, real-capture-windows]
if: always()
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 5
@@ -353,6 +430,7 @@ jobs:
SCOPE: ${{ needs.scope.result }}
RUN: ${{ needs.scope.outputs.run }}
CAPTURE: ${{ needs.real-capture.result }}
+ CAPTURE_WINDOWS: ${{ needs.real-capture-windows.result }}
TIER: ${{ needs.scope.outputs.tier }}
RUNNERS: ${{ needs.scope.outputs.runners }}
CASE_FILTER: ${{ inputs.case_filter }}
@@ -365,10 +443,11 @@ jobs:
echo "No recording code changed: nothing to verify." | tee -a "$GITHUB_STEP_SUMMARY"
exit 0
fi
- if [[ "$CAPTURE" != success ]]; then
- echo "real capture $CAPTURE ($TIER tier): see the runner jobs" >&2
+ if [[ "$CAPTURE" != success || "$CAPTURE_WINDOWS" != success ]]; then
+ echo "real capture: macOS $CAPTURE, Windows $CAPTURE_WINDOWS ($TIER tier): see the runner jobs" >&2
exit 1
fi
+ RUNNERS=$(python3 -c 'import json, sys; print(json.dumps(json.loads(sys.argv[1]) + ["windows-2022"]))' "$RUNNERS")
if [[ -n "$CASE_FILTER" ]]; then
echo "case filter set: executed-case floor not applied"
exit 0