ci: separate master serial and PR jobs

Skipped matrix jobs never expand matrix display values, so let GitHub use stable job identifiers. Bind optimized jobs to pull requests and the three serial references to master pushes.
This commit is contained in:
Tianyi Cui
2026-07-22 18:17:06 +08:00
parent 41609c4ce4
commit da5a1fc811
4 changed files with 25 additions and 29 deletions

View File

@@ -2,20 +2,18 @@ name: CI
on:
push:
branches: [main, master]
branches: [master]
pull_request:
workflow_dispatch:
inputs:
suite:
description: Manual CI suite to run
required: true
default: serial-reference
default: larger-runner-benchmark
type: choice
options:
- serial-reference
- larger-runner-benchmark
- consolidated-runner-benchmark
- optimized-larger-runners
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -33,7 +31,7 @@ jobs:
# overlaps the complete unsharded primary Node inventory. Build starts eagerly;
# only consumers of emitted output wait for it.
node-24:
if: github.event_name != 'workflow_dispatch' || inputs.suite == 'optimized-larger-runners'
if: github.event_name == 'pull_request'
runs-on: dsh-ubuntu-24-04-96core
name: node 24 / complete
env:
@@ -88,7 +86,7 @@ jobs:
node-compat:
if: github.event_name != 'workflow_dispatch' || inputs.suite == 'optimized-larger-runners'
if: github.event_name == 'pull_request'
# Distinct larger-runner pools avoid both standard-runner setup outliers and
# delayed allocation when independent environment contracts share one pool.
runs-on: ${{ matrix.runner }}
@@ -135,7 +133,7 @@ jobs:
run: pnpm run check:node-compat
python-sdk:
if: github.event_name != 'workflow_dispatch' || inputs.suite == 'optimized-larger-runners'
if: github.event_name == 'pull_request'
runs-on: dsh-ubuntu-24-04-8core
name: python 3.10 / keyless SDK
steps:
@@ -156,7 +154,7 @@ jobs:
# complete observational portability inventory. run-gates reports failures
# from observational gates without allowing them to fail the required job.
windows:
if: github.event_name != 'workflow_dispatch' || inputs.suite == 'optimized-larger-runners'
if: github.event_name == 'pull_request'
runs-on: dsh-windows-2025-32core
name: windows node 24 / complete
env:
@@ -208,12 +206,12 @@ jobs:
shell: pwsh
run: pnpm run check:ci:windows-complete
# Manual reference runs deliberately avoid the optimized jobs above.
# Master pushes run only the serial reference jobs below.
# Each host executes the complete, unsharded primary Node aggregate with one
# gate worker, giving reviewers a simple cross-platform oracle for completeness
# and timing.
serial-linux:
if: github.event_name == 'workflow_dispatch' && inputs.suite == 'serial-reference'
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: serial / linux
runs-on: ubuntu-latest
steps:
@@ -242,7 +240,7 @@ jobs:
run: pnpm run check:ci
serial-macos:
if: github.event_name == 'workflow_dispatch' && inputs.suite == 'serial-reference'
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: serial / macos
runs-on: macos-latest
steps:
@@ -268,7 +266,7 @@ jobs:
run: pnpm run check:ci
serial-windows:
if: github.event_name == 'workflow_dispatch' && inputs.suite == 'serial-reference'
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: serial / windows
runs-on: windows-2025
steps:
@@ -306,7 +304,6 @@ jobs:
# The named pools are restricted at the organization level to this repository.
larger-runner-benchmark:
if: github.event_name == 'workflow_dispatch' && inputs.suite == 'larger-runner-benchmark'
name: larger runner / ${{ matrix.platform }} / ${{ matrix.cores }} cores / ${{ matrix.workload }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
strategy:
@@ -407,7 +404,6 @@ jobs:
# Windows runs both blocking build surfaces concurrently through run-gates.
consolidated-runner-benchmark:
if: github.event_name == 'workflow_dispatch' && inputs.suite == 'consolidated-runner-benchmark'
name: consolidated / ${{ matrix.platform }} / ${{ matrix.cores }} cores
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
strategy:
@@ -556,7 +552,7 @@ jobs:
name: all checks passed
runs-on: ubuntu-latest
needs: [node-24, node-compat, python-sdk, windows]
if: always() && (github.event_name != 'workflow_dispatch' || inputs.suite == 'optimized-larger-runners')
if: always() && github.event_name == 'pull_request'
steps:
- name: Fail if any needed job did not succeed
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')