ci: move macOS/Windows tests and CodeQL off the per-PR path (#5813)

These three jobs reran on every PR push but rarely caught push-to-push
regressions: macOS/Windows are the slowest, costliest runners and platform
breakage is rare per iteration, and CodeQL findings seldom change between
pushes. Gate all three off the pull_request event so they no longer sit on
every PR's critical path. They still run on push to main (and in the merge
queue once enabled), so platform and security regressions are still caught
before release. The only required status check, Test (ubuntu-latest, Node
22.x), is unaffected and keeps running on PRs.
This commit is contained in:
易良 2026-06-24 18:59:47 +08:00 committed by GitHub
parent 18373fb963
commit f6c8ee1e85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -273,7 +273,12 @@ jobs:
test_platforms:
name: 'Test (${{ matrix.os }}, Node ${{ matrix.node-version }})'
needs: 'classify_pr'
if: '${{ !cancelled() }}'
# macOS/Windows are the slowest, costliest runners and platform-specific
# regressions are rare per push, so rerunning them on every review iteration
# is mostly wasted. Skip on PR pushes; they still run on push to `main` (and
# in the merge queue, once enabled), catching platform breakage before it
# ships without sitting on every PR's critical path.
if: "${{ !cancelled() && github.event_name != 'pull_request' }}"
runs-on: '${{ fromJSON(matrix.runner) }}'
permissions:
contents: 'read'
@ -374,7 +379,10 @@ jobs:
codeql:
name: 'CodeQL'
needs: 'classify_pr'
if: "${{ !cancelled() && needs.classify_pr.outputs.skip_ci != 'true' }}"
# Security findings rarely change push-to-push, so a slow scan on every PR
# push is poor value. Skip on PR pushes; CodeQL still runs on push to `main`
# (and in the merge queue, once enabled) as the pre-/post-merge backstop.
if: "${{ !cancelled() && needs.classify_pr.outputs.skip_ci != 'true' && github.event_name != 'pull_request' }}"
runs-on: 'ubuntu-latest'
# Analysis normally finishes in ~7-9 min (22 min worst case observed). Without
# an explicit cap, a hosted runner that drops its heartbeat mid-analysis leaves