diff --git a/.github/workflows/pages-publish.yml b/.github/workflows/pages-publish.yml index 98293411a..6319af2e2 100644 --- a/.github/workflows/pages-publish.yml +++ b/.github/workflows/pages-publish.yml @@ -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 + # 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' }} diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 77e2af863..cbf48e7dc 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -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' @@ -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. diff --git a/tests/ci_workflow_efficiency_test.mjs b/tests/ci_workflow_efficiency_test.mjs index 5c0b36d12..ef43edf92 100644 --- a/tests/ci_workflow_efficiency_test.mjs +++ b/tests/ci_workflow_efficiency_test.mjs @@ -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); @@ -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); @@ -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@/);