Skip to content

build(ci): Small fixes to hopefully resolve caching issues #10841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,12 @@ jobs:
needs.job_get_metadata.outputs.force_skip_cache == 'false'
with:
path: .nxcache
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT || github.sha }}
# On develop branch, we want to _store_ the cache (so it can be used by other branches), but never _restore_ from it
restore-keys:
${{needs.job_get_metadata.outputs.is_develop == 'false' && env.NX_CACHE_RESTORE_KEYS || 'nx-never-restore'}}

- name: Build packages
# Under normal circumstances, using the git SHA as a cache key, there shouldn't ever be a cache hit on the built
# packages, and so `yarn build` should always run. This `if` check is therefore only there for testing CI issues
# where the built packages are beside the point. In that case, you can change `BUILD_CACHE_KEY` (at the top of
# this file) to a constant and skip rebuilding all of the packages each time CI runs.
if: steps.cache_built_packages.outputs.cache-hit == ''
run: yarn build
outputs:
# this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json"],
"sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json", "{workspaceRoot}/yarn.lock"],
"production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md", "!{projectRoot}/*.tgz"]
},
"targetDefaults": {
Expand Down