From be470be3e5cea87905078439d267cd71fc711c9d Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 28 Feb 2024 11:43:49 +0000 Subject: [PATCH] build(ci): Small fixes to hopefully resolve caching issues? --- .github/workflows/build.yml | 7 +------ nx.json | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06131c73b84a..b780353a619a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/nx.json b/nx.json index d45d9b5eaef8..e65250382e1c 100644 --- a/nx.json +++ b/nx.json @@ -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": {