Skip to content

Commit 5d85a44

Browse files
authored
fix(CI): Avoid rebuilding native code in jobs that don't depend on native code (vercel#78944)
The following jobs do not depend on `build-native`, but don't specify `skipNativeBuild`: - `lint` - `test-devlow` - `test-next-swc-wasm` - `test-next-swc-napi-wasi` *(currently disabled)* - `test-unit` *(does actually appear to depend on native binaries)* That means that they still build the native binary, but they don't wait for `build-native` to finish first, so they don't use the cached version (they run before the cache is populated), and instead each spend 5 minutes of CPU time rebuilding the native binary.
1 parent 245406a commit 5d85a44

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/build_and_test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
needs: ['build-next']
8787
uses: ./.github/workflows/build_reusable.yml
8888
with:
89+
skipNativeBuild: 'yes'
90+
skipNativeInstall: 'yes'
8991
afterBuild: |
9092
pnpm lint-no-typescript
9193
pnpm check-examples
@@ -213,6 +215,7 @@ jobs:
213215
if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }}
214216
uses: ./.github/workflows/build_reusable.yml
215217
with:
218+
skipNativeBuild: 'yes'
216219
stepName: 'test-devlow'
217220
afterBuild: |
218221
pnpm run --filter=devlow-bench test
@@ -342,6 +345,8 @@ jobs:
342345

343346
uses: ./.github/workflows/build_reusable.yml
344347
with:
348+
skipNativeBuild: 'yes'
349+
skipNativeInstall: 'yes'
345350
afterBuild: |
346351
rustup target add wasm32-unknown-unknown
347352
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
@@ -371,6 +376,8 @@ jobs:
371376

372377
uses: ./.github/workflows/build_reusable.yml
373378
with:
379+
skipNativeBuild: 'yes'
380+
skipNativeInstall: 'yes'
374381
afterBuild: |
375382
rustup target add wasm32-wasip1-threads
376383
pnpm dlx turbo@${TURBO_VERSION} run build-native-wasi
@@ -379,7 +386,7 @@ jobs:
379386

380387
test-unit:
381388
name: test unit
382-
needs: ['changes']
389+
needs: ['changes', 'build-next', 'build-native']
383390
if: ${{ needs.changes.outputs.docs-only == 'false' }}
384391

385392
strategy:

0 commit comments

Comments
 (0)