Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

ci: run the FULL verification tier once a pull request is ready

Richie McIlroyff6f2e766d78
diff --git a/.github/workflows/engine-verify.yml b/.github/workflows/engine-verify.yml
index bf102b78c..07a176dc7 100644
--- a/.github/workflows/engine-verify.yml
+++ b/.github/workflows/engine-verify.yml
@@ -4,10 +4,11 @@ name: Engine verify
# and captions engines (crates/verify, crates/verify-expect, the decoder model
# fuzzer in cap-rendering). See crates/verify/README.md.
#
-# Tiers: FULL for every pull request that changes an engine crate
-# (scripts/verify/plan.py ENGINE_CRATES) or a high-risk region, with the
+# Tiers: FULL for every ready (non-draft) pull request that changes an engine
+# crate (scripts/verify/plan.py ENGINE_CRATES) or a high-risk region, with the
# `verify-full` label (engine-verify-label.yml), in the merge queue and
-# nightly; FAST for other pull requests. Only suites whose
+# nightly; FAST for drafts and other pull requests. Marking a draft ready
+# runs the FULL tier on the head that will merge. Only suites whose
# code a change can reach run (scripts/verify/plan.py maps changed paths to
# suites through the workspace dependency graph), and only on the platforms
# where they test platform code. The "Engine verify" job is the one to require.
@@ -169,11 +170,16 @@ jobs:
ENGINE: ${{ steps.risk.outputs.engine }}
EVENT: ${{ github.event_name }}
BASE: ${{ inputs.base }}
+ DRAFT: ${{ github.event.pull_request.draft }}
run: |
tier="$TIER"
if [[ ( "$ESCALATE" == true || "$ENGINE" == true ) && ( "$EVENT" == pull_request || -n "$BASE" ) && "$tier" == fast ]]; then
- tier=full
- echo "Engine or high-risk code changed: running the FULL tier." | tee -a "$GITHUB_STEP_SUMMARY"
+ if [[ "$DRAFT" == true ]]; then
+ echo "Engine or high-risk code changed in a draft: FAST tier; marking the pull request ready runs the FULL tier." | tee -a "$GITHUB_STEP_SUMMARY"
+ else
+ tier=full
+ echo "Engine or high-risk code changed: running the FULL tier." | tee -a "$GITHUB_STEP_SUMMARY"
+ fi
fi
echo "tier=$tier" >> "$GITHUB_OUTPUT"
diff --git a/.github/workflows/verify-recording.yml b/.github/workflows/verify-recording.yml
index e0a96fb91..c4b36a577 100644
--- a/.github/workflows/verify-recording.yml
+++ b/.github/workflows/verify-recording.yml
@@ -9,9 +9,9 @@ name: Verify recording (real capture)
# - Scope decides from the diff whether the change reaches the recorder's or
# the stimulus's dependency closure or the harness (scripts/verify/plan.py
# recording); a pull request that does not is green without running;
-# - one that does runs the FAST tier on Blacksmith macOS 15, or the FULL tier
-# on Blacksmith macOS 15 and 26 when it touches a high-risk region or an
-# engine crate; nightly runs FULL on Blacksmith and GitHub-hosted macOS 15
+# - one that does runs the FAST tier on Blacksmith macOS 15, or, once it is
+# ready for review (not a draft), the FULL tier on Blacksmith macOS 15 and
+# 26 when it touches a high-risk region or an engine crate; nightly runs FULL on Blacksmith and GitHub-hosted macOS 15
# and 26, dispatch FULL on the chosen runners.
#
# Runners: Blacksmith macOS (M4 Pro VM, 6 vCPU, no concurrency cap) for pull
@@ -86,6 +86,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
EVENT: ${{ github.event_name }}
PR: ${{ github.event.pull_request.number }}
+ DRAFT: ${{ github.event.pull_request.draft }}
BEFORE: ${{ github.event.before }}
INPUT_TIER: ${{ inputs.tier }}
INPUT_RUNNERS: ${{ inputs.runners }}
@@ -121,7 +122,7 @@ jobs:
cat "$RUNNER_TEMP/scope.txt"
run="$(sed -n 's/^run=//p' "$RUNNER_TEMP/scope.txt")"
python3 scripts/verify/plan.py risk --files "$files" --summary "$GITHUB_STEP_SUMMARY" --output "$RUNNER_TEMP/risk.txt"
- if grep -qx 'escalate=true' "$RUNNER_TEMP/risk.txt" || grep -qx 'engine=true' "$RUNNER_TEMP/risk.txt"; then
+ if [[ "${DRAFT:-false}" != true ]] && { grep -qx 'escalate=true' "$RUNNER_TEMP/risk.txt" || grep -qx 'engine=true' "$RUNNER_TEMP/risk.txt"; }; then
runners="$blacksmith"; tier=full
else
runners='["blacksmith-6vcpu-macos-15"]'; tier=fast