Skip to content

Commit fb90025

Browse files
authored
Merge pull request #877 from heygen-com/ci/fast-fail-and-preflight-gate
ci: fast-fail regression matrix + preflight gate before expensive jobs
2 parents 4fd9520 + 0098413 commit fb90025

6 files changed

Lines changed: 89 additions & 7 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Preflight
2+
description: |
3+
Cheap lint + format gate that runs before expensive CI jobs (regression
4+
shards, perf shards, parity renders, Windows renders, catalog previews).
5+
Single source of truth for the gate's bun/node/cache/lint/format steps —
6+
tweak here and every preflight job picks it up.
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
12+
13+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
14+
with:
15+
node-version: 22
16+
17+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
18+
with:
19+
path: ~/.bun/install/cache
20+
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
21+
restore-keys: |
22+
bun-${{ runner.os }}-
23+
24+
- shell: bash
25+
run: bun install --frozen-lockfile
26+
27+
- shell: bash
28+
run: bun run lint
29+
30+
- shell: bash
31+
run: bun run format:check

.github/workflows/catalog-previews.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
jobs:
20+
preflight:
21+
name: Preflight (lint + format)
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
26+
- uses: ./.github/actions/preflight
27+
2028
render-previews:
2129
name: Render catalog previews
30+
needs: preflight
2231
runs-on: ubuntu-latest
2332
timeout-minutes: 30
2433
steps:

.github/workflows/player-perf.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,24 @@ jobs:
3737
- "bun.lock"
3838
- ".github/workflows/player-perf.yml"
3939
40+
preflight:
41+
name: Preflight (lint + format)
42+
needs: changes
43+
if: needs.changes.outputs.perf == 'true'
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 5
46+
steps:
47+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
48+
- uses: ./.github/actions/preflight
49+
4050
perf-shards:
4151
name: "Perf: ${{ matrix.shard }}"
42-
needs: changes
52+
needs: [changes, preflight]
4353
if: needs.changes.outputs.perf == 'true'
4454
runs-on: ubuntu-latest
4555
timeout-minutes: 20
4656
strategy:
47-
fail-fast: false
57+
fail-fast: true
4858
matrix:
4959
include:
5060
- shard: load

.github/workflows/preview-regression.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,19 @@ jobs:
4141
- "bun.lock"
4242
- ".github/workflows/preview-regression.yml"
4343
44+
preflight:
45+
name: Preflight (lint + format)
46+
needs: changes
47+
if: needs.changes.outputs.preview == 'true'
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 5
50+
steps:
51+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
52+
- uses: ./.github/actions/preflight
53+
4454
preview-parity:
4555
name: Preview parity
46-
needs: changes
56+
needs: [changes, preflight]
4757
if: needs.changes.outputs.preview == 'true'
4858
runs-on: ubuntu-latest
4959
timeout-minutes: 20

.github/workflows/regression.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,23 @@ jobs:
3434
- "packages/engine/**"
3535
- "Dockerfile*"
3636
37-
regression-shards:
37+
preflight:
38+
name: Preflight (lint + format)
3839
needs: changes
3940
if: needs.changes.outputs.code == 'true'
4041
runs-on: ubuntu-latest
42+
timeout-minutes: 5
43+
steps:
44+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
45+
- uses: ./.github/actions/preflight
46+
47+
regression-shards:
48+
needs: [changes, preflight]
49+
if: needs.changes.outputs.code == 'true'
50+
runs-on: ubuntu-latest
4151
timeout-minutes: 60
4252
strategy:
43-
fail-fast: false
53+
fail-fast: true
4454
matrix:
4555
# Shards are bin-packed by measured per-test duration (LPT heuristic on
4656
# CI run 25893372795) so each row carries ~15-16 min of work. When a

.github/workflows/windows-render.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,21 @@ jobs:
5757
- "bun.lock"
5858
- ".github/workflows/windows-render.yml"
5959
60+
preflight:
61+
name: Preflight (lint + format)
62+
needs: changes
63+
if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
64+
runs-on: ubuntu-latest
65+
timeout-minutes: 5
66+
steps:
67+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
68+
with:
69+
ref: ${{ github.event.inputs.ref }}
70+
- uses: ./.github/actions/preflight
71+
6072
render-windows:
6173
name: Render on windows-latest
62-
needs: changes
74+
needs: [changes, preflight]
6375
if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
6476
runs-on: windows-latest
6577
timeout-minutes: 30
@@ -344,7 +356,7 @@ jobs:
344356
# -------------------------------------------------------------------
345357
test-windows:
346358
name: Tests on windows-latest
347-
needs: changes
359+
needs: [changes, preflight]
348360
if: needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
349361
runs-on: windows-latest
350362
timeout-minutes: 20

0 commit comments

Comments
 (0)