Skip to content

Commit 0098413

Browse files
jrusso1020claude
andcommitted
ci(preflight): extract preflight steps into a composite action
Same 5-step preflight body (setup-bun, setup-node, cache, install, lint, format:check) was duplicated across 5 workflows. Move it to .github/actions/preflight/action.yml so future tweaks (adding typecheck, swapping the cache key, etc.) are a single-file change. Net diff: +33 / -65. Addresses the "shared preflight" follow-up Vai called out on #877. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e29d7db commit 0098413

6 files changed

Lines changed: 36 additions & 65 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: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,7 @@ jobs:
2323
timeout-minutes: 5
2424
steps:
2525
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
26-
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
27-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
28-
with:
29-
node-version: 22
30-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
31-
with:
32-
path: ~/.bun/install/cache
33-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
34-
restore-keys: |
35-
bun-${{ runner.os }}-
36-
- run: bun install --frozen-lockfile
37-
- run: bun run lint
38-
- run: bun run format:check
26+
- uses: ./.github/actions/preflight
3927

4028
render-previews:
4129
name: Render catalog previews

.github/workflows/player-perf.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,7 @@ jobs:
4545
timeout-minutes: 5
4646
steps:
4747
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
48-
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
49-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
50-
with:
51-
node-version: 22
52-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
53-
with:
54-
path: ~/.bun/install/cache
55-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
56-
restore-keys: |
57-
bun-${{ runner.os }}-
58-
- run: bun install --frozen-lockfile
59-
- run: bun run lint
60-
- run: bun run format:check
48+
- uses: ./.github/actions/preflight
6149

6250
perf-shards:
6351
name: "Perf: ${{ matrix.shard }}"

.github/workflows/preview-regression.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,7 @@ jobs:
4949
timeout-minutes: 5
5050
steps:
5151
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
52-
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
53-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
54-
with:
55-
node-version: 22
56-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
57-
with:
58-
path: ~/.bun/install/cache
59-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
60-
restore-keys: |
61-
bun-${{ runner.os }}-
62-
- run: bun install --frozen-lockfile
63-
- run: bun run lint
64-
- run: bun run format:check
52+
- uses: ./.github/actions/preflight
6553

6654
preview-parity:
6755
name: Preview parity

.github/workflows/regression.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,7 @@ jobs:
4242
timeout-minutes: 5
4343
steps:
4444
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
45-
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
46-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
47-
with:
48-
node-version: 22
49-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
50-
with:
51-
path: ~/.bun/install/cache
52-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
53-
restore-keys: |
54-
bun-${{ runner.os }}-
55-
- run: bun install --frozen-lockfile
56-
- run: bun run lint
57-
- run: bun run format:check
45+
- uses: ./.github/actions/preflight
5846

5947
regression-shards:
6048
needs: [changes, preflight]

.github/workflows/windows-render.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,7 @@ jobs:
6767
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
6868
with:
6969
ref: ${{ github.event.inputs.ref }}
70-
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
71-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
72-
with:
73-
node-version: 22
74-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
75-
with:
76-
path: ~/.bun/install/cache
77-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
78-
restore-keys: |
79-
bun-${{ runner.os }}-
80-
- run: bun install --frozen-lockfile
81-
- run: bun run lint
82-
- run: bun run format:check
70+
- uses: ./.github/actions/preflight
8371

8472
render-windows:
8573
name: Render on windows-latest

0 commit comments

Comments
 (0)