@@ -17,10 +17,11 @@ concurrency:
1717 cancel-in-progress : true
1818
1919jobs :
20- build-and-lint :
21- name : Build and lint web apps
20+ # Format check has no build dependencies - run immediately in parallel
21+ check-format :
22+ name : check:format
2223 runs-on : ubuntu-latest
23- timeout-minutes : 25
24+ timeout-minutes : 10
2425 if : |
2526 github.event.pull_request.draft == false &&
2627 github.event.pull_request.requested_reviewers != null
@@ -29,28 +30,140 @@ jobs:
2930 TURBO_SCM_HEAD : ${{ github.sha }}
3031 steps :
3132 - name : Checkout code
32- uses : actions/checkout@v4
33+ uses : actions/checkout@v6
3334 with :
3435 fetch-depth : 50
3536 filter : blob:none
3637
3738 - name : Set up Node.js
38- uses : actions/setup-node@v4
39+ uses : actions/setup-node@v6
3940
4041 - name : Enable Corepack and pnpm
4142 run : corepack enable pnpm
4243
44+ - name : Get pnpm store directory
45+ shell : bash
46+ run : echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
47+
48+ - name : Cache pnpm store
49+ uses : actions/cache@v4
50+ with :
51+ path : ${{ env.STORE_PATH }}
52+ key : pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
53+ restore-keys : |
54+ pnpm-store-${{ runner.os }}-
55+
4356 - name : Install dependencies
4457 run : pnpm install --frozen-lockfile
4558
46- - name : Build Affected
59+ - name : Check formatting
60+ run : pnpm turbo run check:format --affected
61+
62+ # Build packages - required for lint and type checks
63+ build :
64+ name : Build packages
65+ runs-on : ubuntu-latest
66+ timeout-minutes : 15
67+ if : |
68+ github.event.pull_request.draft == false &&
69+ github.event.pull_request.requested_reviewers != null
70+ env :
71+ TURBO_SCM_BASE : ${{ github.event.pull_request.base.sha }}
72+ TURBO_SCM_HEAD : ${{ github.sha }}
73+ NODE_OPTIONS : " --max-old-space-size=4096"
74+ steps :
75+ - name : Checkout code
76+ uses : actions/checkout@v6
77+ with :
78+ fetch-depth : 50
79+ filter : blob:none
80+
81+ - name : Set up Node.js
82+ uses : actions/setup-node@v6
83+
84+ - name : Enable Corepack and pnpm
85+ run : corepack enable pnpm
86+
87+ - name : Get pnpm store directory
88+ shell : bash
89+ run : echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
90+
91+ - name : Cache pnpm store
92+ uses : actions/cache@v4
93+ with :
94+ path : ${{ env.STORE_PATH }}
95+ key : pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
96+ restore-keys : |
97+ pnpm-store-${{ runner.os }}-
98+
99+ - name : Restore Turbo cache
100+ uses : actions/cache/restore@v4
101+ with :
102+ path : .turbo
103+ key : turbo-${{ runner.os }}-${{ github.event.pull_request.base.sha }}-${{ github.sha }}
104+ restore-keys : |
105+ turbo-${{ runner.os }}-${{ github.event.pull_request.base.sha }}-
106+ turbo-${{ runner.os }}-
107+
108+ - name : Install dependencies
109+ run : pnpm install --frozen-lockfile
110+
111+ - name : Build packages
47112 run : pnpm turbo run build --affected
48113
49- - name : Lint Affected
50- run : pnpm turbo run check:lint --affected
114+ - name : Save Turbo cache
115+ uses : actions/cache/save@v4
116+ with :
117+ path : .turbo
118+ key : turbo-${{ runner.os }}-${{ github.event.pull_request.base.sha }}-${{ github.sha }}
51119
52- - name : Check Affected format
53- run : pnpm turbo run check:format --affected
120+ # Lint and type checks depend on build artifacts
121+ check :
122+ name : ${{ matrix.task }}
123+ runs-on : ubuntu-latest
124+ needs : build
125+ timeout-minutes : 15
126+ strategy :
127+ fail-fast : false
128+ matrix :
129+ task : [check:lint, check:types]
130+ env :
131+ TURBO_SCM_BASE : ${{ github.event.pull_request.base.sha }}
132+ TURBO_SCM_HEAD : ${{ github.sha }}
133+ NODE_OPTIONS : " --max-old-space-size=4096"
134+ steps :
135+ - name : Checkout code
136+ uses : actions/checkout@v6
137+ with :
138+ fetch-depth : 50
139+ filter : blob:none
140+
141+ - name : Set up Node.js
142+ uses : actions/setup-node@v6
143+
144+ - name : Enable Corepack and pnpm
145+ run : corepack enable pnpm
146+
147+ - name : Get pnpm store directory
148+ shell : bash
149+ run : echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
150+
151+ - name : Cache pnpm store
152+ uses : actions/cache@v4
153+ with :
154+ path : ${{ env.STORE_PATH }}
155+ key : pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
156+ restore-keys : |
157+ pnpm-store-${{ runner.os }}-
158+
159+ - name : Restore Turbo cache
160+ uses : actions/cache/restore@v4
161+ with :
162+ path : .turbo
163+ key : turbo-${{ runner.os }}-${{ github.event.pull_request.base.sha }}-${{ github.sha }}
164+
165+ - name : Install dependencies
166+ run : pnpm install --frozen-lockfile
54167
55- - name : Check Affected types
56- run : pnpm turbo run check:types --affected
168+ - name : Run ${{ matrix.task }}
169+ run : pnpm turbo run ${{ matrix.task }} --affected
0 commit comments