Skip to content

Commit bc28240

Browse files
authored
build(ci): Small fixes to hopefully resolve caching issues (#10841)
For whatever reason, builds are weirdly failing now on CI, most probably due to caching issues etc... let's see if this can fix this, possibly...
1 parent e1063f4 commit bc28240

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,17 +267,12 @@ jobs:
267267
needs.job_get_metadata.outputs.force_skip_cache == 'false'
268268
with:
269269
path: .nxcache
270-
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
270+
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT || github.sha }}
271271
# On develop branch, we want to _store_ the cache (so it can be used by other branches), but never _restore_ from it
272272
restore-keys:
273273
${{needs.job_get_metadata.outputs.is_develop == 'false' && env.NX_CACHE_RESTORE_KEYS || 'nx-never-restore'}}
274274

275275
- name: Build packages
276-
# Under normal circumstances, using the git SHA as a cache key, there shouldn't ever be a cache hit on the built
277-
# packages, and so `yarn build` should always run. This `if` check is therefore only there for testing CI issues
278-
# where the built packages are beside the point. In that case, you can change `BUILD_CACHE_KEY` (at the top of
279-
# this file) to a constant and skip rebuilding all of the packages each time CI runs.
280-
if: steps.cache_built_packages.outputs.cache-hit == ''
281276
run: yarn build
282277
outputs:
283278
# this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"namedInputs": {
1212
"default": ["{projectRoot}/**/*", "sharedGlobals"],
13-
"sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json"],
13+
"sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json", "{workspaceRoot}/yarn.lock"],
1414
"production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md", "!{projectRoot}/*.tgz"]
1515
},
1616
"targetDefaults": {

0 commit comments

Comments
 (0)