Skip to content

Commit 6b6e746

Browse files
authored
fix(build): Narrow scope of build cache in GHA (#5105)
Currently, as part of caching our built files in GHA, we cache any directory named `build`, `cjs`, or `esm`, no matter how deeply nested. As a result, we end up caching files from any number of node modules which happen to contain directories of the same name(s). Since we have a separate dependency cache, this is redundant and only serves to slow down our CI checks. This fixes that problem by narrowing the scope to the `build` folder at the top level of each package, so that now we upload ~2700 files rather than ~4000. Two legitimate files which would otherwise be excluded as a result of this change have also been added to the cache.
1 parent 78d7304 commit 6b6e746

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ env:
2424
2525
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
2626

27+
# packages/utils/cjs and packages/utils/esm: Symlinks to the folders inside of `build`, needed for tests
2728
CACHED_BUILD_PATHS: |
28-
${{ github.workspace }}/packages/**/build
29-
${{ github.workspace }}/packages/**/cjs
30-
${{ github.workspace }}/packages/**/esm
29+
${{ github.workspace }}/packages/*/build
3130
${{ github.workspace }}/packages/ember/*.d.ts
3231
${{ github.workspace }}/packages/ember/instance-initializers
3332
${{ github.workspace }}/packages/gatsby/*.d.ts
3433
${{ github.workspace }}/packages/core/src/version.ts
3534
${{ github.workspace }}/dist-serverless
35+
${{ github.workspace }}/packages/utils/cjs
36+
${{ github.workspace }}/packages/utils/esm
3637
3738
BUILD_CACHE_KEY: ${{ github.event.inputs.commit || github.sha }}
3839

0 commit comments

Comments
 (0)