Open ethanr-bjss opened 1 week ago
FWIW I have the same setup, the following worked for me
...
- name: Restore Nx cache
id: restore_nx_cache
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}/src/.nx
!${{ github.workspace }}/src/.nx/workspace-data/d
key: nx-cache
restore-keys: |
nx-cache-
...
- name: Save Nx cache
if: ${{ always() }}
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}/src/.nx
!${{ github.workspace }}/src/.nx/workspace-data/d
key: nx-cache-${{ hashFiles('src/.nx/**', '!src/.nx/workspace-data/d/**') }}
...
and these environment variables set
NX_DISABLE_DB: true
NX_DB_CACHE: false
Current Behavior
We are using GitHub Actions cache as our NX cache, which we require due to organisational constraints. In line with guidance here, we have set NX_REJECT_UNKNOWN_LOCAL_CACHE=0 on all of our jobs.
In version 19.8.x, this works to prevent additional build/lint/test when there has been no change.
Since upgrading to 20.0.x, we are seeing the "Unrecognised cache artifacts" error when trying to load the GitHub cache.
Expected Behavior
NX does not reject the unknown local cache, and uses it to prevent duplicate build/lint/test.
GitHub Repo
https://github.com/ethanr-bjss/nx-local-cache-reproduce
Steps to Reproduce
In the attached repository, I've set up two action runs. The first was run
v19 (see retry for cache usage) - https://github.com/ethanr-bjss/nx-local-cache-reproduce/actions/runs/11814791261 commit - https://github.com/ethanr-bjss/nx-local-cache-reproduce/commit/bb22fc9bc6c9d047658bbaaf63f60bdb088a8ef5
v20 - https://github.com/ethanr-bjss/nx-local-cache-reproduce/actions/runs/11814867370 commit - https://github.com/ethanr-bjss/nx-local-cache-reproduce/commit/50382374d75f17977ae8eaef465cd2c3c7e629be
I suggest cloning this repository, and manually running the action as required.
Nx Report
Failure Logs
Package Manager Version
pnpm@9.7.1
Operating System
Additional Information
No response