Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/pages-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,25 @@ jobs:
with:
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || 'main' }}
persist-credentials: false
fetch-depth: 2 # Compare the exact main commit to its first parent without full history.
- name: Skip superseded Pages builds
id: guard
shell: bash
run: |
SOURCE_SHA="$(git rev-parse HEAD)"
CURRENT_MAIN="$(git ls-remote origin refs/heads/main | cut -f1)"
if [ "$SOURCE_SHA" = "$CURRENT_MAIN" ]; then
echo "fresh=true" >> "$GITHUB_OUTPUT"
else
if [ "$SOURCE_SHA" != "$CURRENT_MAIN" ]; then
echo "fresh=false" >> "$GITHUB_OUTPUT"
echo "Skipping obsolete qualified Pages SHA $SOURCE_SHA; main is $CURRENT_MAIN"
elif [ "${{ github.event_name }}" = "workflow_run" ] && git diff --quiet HEAD^ HEAD -- \
site/ web/ AR-MIX-Live-FX-Host-Standalone-v0.3.html \
scripts/build_pages.py scripts/build_ui_css.py; then
Comment on lines +39 to +41

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare against the last published revision before skipping Pages

If a GUI-changing main push A is followed by a test-only push B before A publishes, neither revision will deploy: .github/workflows/ui-smoke.yml:48–50 allows B to cancel A's verification, and the Pages publisher's existing obsolete-head guard skips A even if its verification finishes. B then passes this new parent-only comparison and skips publication despite containing A's unpublished GUI changes. The public preview consequently remains stale until another GUI change or manual dispatch. Base the skip decision on the last successfully published revision, rather than assuming the immediate parent was deployed.

Useful? React with 👍 / 👎.

# A test-only / workflow-only main push needs verification, not a
# redundant Pages deployment. Manual dispatch always publishes.
echo "fresh=false" >> "$GITHUB_OUTPUT"
echo "Skipping Pages: no published GUI/landing/assets changed in $SOURCE_SHA"
else
echo "fresh=true" >> "$GITHUB_OUTPUT"
fi
- uses: actions/setup-python@v5
if: ${{ steps.guard.outputs.fresh == 'true' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- 'tests/*gui*contract*.mjs'
- 'tests/native_ui_contract_test.mjs'
- 'tests/wire_graph_canonical_model.test.cjs'
- 'tests/wire_main_native_handoff_contract.test.cjs'
- 'tests/ci_workflow_efficiency_test.mjs'
- 'scripts/build_ui_css.py'
- '.github/workflows/ui-smoke.yml'
Expand All @@ -36,6 +37,7 @@ on:
- 'tests/native_orbit_ui_smoke.py'
- 'tests/ci_workflow_efficiency_test.mjs'
- 'tests/wire_graph_canonical_model.test.cjs'
- 'tests/wire_main_native_handoff_contract.test.cjs'
- '.github/workflows/ui-smoke.yml'
- '.github/workflows/pages-publish.yml'
# Manual full suite (including immutable CSS migration tests) or release-integration PR.
Expand Down
7 changes: 7 additions & 0 deletions tests/ci_workflow_efficiency_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ test('docs and isolated CI tests do not fan out into unrelated builds', () => {
for (const filename of [
'tests/pages_wire_first_canonical_main_smoke.py',
'tests/wire_graph_canonical_model.test.cjs',
'tests/wire_main_native_handoff_contract.test.cjs',
'tests/ci_workflow_efficiency_test.mjs'
]) {
assert.equal(selected(windowsPR, filename), false);
Expand All @@ -103,6 +104,7 @@ test('ordinary GUI PR and main use current targeted checks; full history is expl
assert.match(ui, /cancel-in-progress: true/);
assert.match(ui, /python tests\/pages_wire_first_canonical_main_smoke.py/);
assert.match(ui, /python tests\/pages_v55_context_wire_fader_smoke.py/);
assert.match(ui, /node tests\/wire_main_native_handoff_contract.test.cjs/);
assert.match(ui, /python tests\/pages_v51_portrait_led_peak_hold_smoke.py/);
const fullOnly = [...ui.matchAll(/^\s{8}if: .*workflow_dispatch.*integration\/product-/gm)].length;
assert.ok(fullOnly >= 35, 'Historical/extended GUI steps must be opt-in, found ' + fullOnly);
Expand All @@ -125,6 +127,11 @@ test('Pages is single guarded downstream publisher, never triggered by PR comple
assert.match(pages, /workflows: \["UI smoke \(Chromium\)"\]/);
assert.match(pages, /github\.event\.workflow_run\.event == 'push'/);
assert.match(pages, /git ls-remote origin refs\/heads\/main/);
assert.match(pages, /fetch-depth: 2/);
assert.match(pages, /git diff --quiet HEAD\^ HEAD --/);
assert.match(pages, /site\/ web\/ AR-MIX-Live-FX-Host-Standalone-v0\.3\.html/);
assert.match(pages, /scripts\/build_pages\.py scripts\/build_ui_css\.py/);
assert.match(pages, /Skipping Pages: no published GUI\/landing\/assets changed/);
assert.match(pages, /needs\.build\.outputs\.fresh == 'true'/);
assert.doesNotMatch(ui, /actions\/deploy-pages@/);
assert.doesNotMatch(native, /actions\/deploy-pages@/);
Expand Down
Loading