Merge pull request #877 from heygen-com/ci/fast-fail-and-preflight-gate

ci: fast-fail regression matrix + preflight gate before expensive jobs
This commit is contained in:
James Russo
2026-05-15 18:51:41 -04:00
committed by GitHub
6 changed files with 89 additions and 7 deletions
+31
View File
@@ -0,0 +1,31 @@
name: Preflight
description: |
Cheap lint + format gate that runs before expensive CI jobs (regression
shards, perf shards, parity renders, Windows renders, catalog previews).
Single source of truth for the gate's bun/node/cache/lint/format steps —
tweak here and every preflight job picks it up.
runs:
using: composite
steps:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- shell: bash
run: bun install --frozen-lockfile
- shell: bash
run: bun run lint
- shell: bash
run: bun run format:check
+9
View File
@@ -17,8 +17,17 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
preflight:
name: Preflight (lint + format)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: ./.github/actions/preflight
render-previews: render-previews:
name: Render catalog previews name: Render catalog previews
needs: preflight
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
+12 -2
View File
@@ -37,14 +37,24 @@ jobs:
- "bun.lock" - "bun.lock"
- ".github/workflows/player-perf.yml" - ".github/workflows/player-perf.yml"
preflight:
name: Preflight (lint + format)
needs: changes
if: needs.changes.outputs.perf == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: ./.github/actions/preflight
perf-shards: perf-shards:
name: "Perf: ${{ matrix.shard }}" name: "Perf: ${{ matrix.shard }}"
needs: changes needs: [changes, preflight]
if: needs.changes.outputs.perf == 'true' if: needs.changes.outputs.perf == 'true'
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 20 timeout-minutes: 20
strategy: strategy:
fail-fast: false fail-fast: true
matrix: matrix:
include: include:
- shard: load - shard: load
+11 -1
View File
@@ -41,9 +41,19 @@ jobs:
- "bun.lock" - "bun.lock"
- ".github/workflows/preview-regression.yml" - ".github/workflows/preview-regression.yml"
preflight:
name: Preflight (lint + format)
needs: changes
if: needs.changes.outputs.preview == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: ./.github/actions/preflight
preview-parity: preview-parity:
name: Preview parity name: Preview parity
needs: changes needs: [changes, preflight]
if: needs.changes.outputs.preview == 'true' if: needs.changes.outputs.preview == 'true'
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 20 timeout-minutes: 20
+12 -2
View File
@@ -34,13 +34,23 @@ jobs:
- "packages/engine/**" - "packages/engine/**"
- "Dockerfile*" - "Dockerfile*"
regression-shards: preflight:
name: Preflight (lint + format)
needs: changes needs: changes
if: needs.changes.outputs.code == 'true' if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: ./.github/actions/preflight
regression-shards:
needs: [changes, preflight]
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
timeout-minutes: 60 timeout-minutes: 60
strategy: strategy:
fail-fast: false fail-fast: true
matrix: matrix:
# Shards are bin-packed by measured per-test duration (LPT heuristic on # Shards are bin-packed by measured per-test duration (LPT heuristic on
# CI run 25893372795) so each row carries ~15-16 min of work. When a # CI run 25893372795) so each row carries ~15-16 min of work. When a
+14 -2
View File
@@ -57,9 +57,21 @@ jobs:
- "bun.lock" - "bun.lock"
- ".github/workflows/windows-render.yml" - ".github/workflows/windows-render.yml"
preflight:
name: Preflight (lint + format)
needs: changes
if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/preflight
render-windows: render-windows:
name: Render on windows-latest name: Render on windows-latest
needs: changes needs: [changes, preflight]
if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch' if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
runs-on: windows-latest runs-on: windows-latest
timeout-minutes: 30 timeout-minutes: 30
@@ -344,7 +356,7 @@ jobs:
# ------------------------------------------------------------------- # -------------------------------------------------------------------
test-windows: test-windows:
name: Tests on windows-latest name: Tests on windows-latest
needs: changes needs: [changes, preflight]
if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch' if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
runs-on: windows-latest runs-on: windows-latest
timeout-minutes: 20 timeout-minutes: 20