Skip to content

Commit 2c12e4d

Browse files
mydeaclaude
andcommitted
fix(ci): Enable cross-OS cache archive for container compatibility
actions/cache computes an internal version hash from the cache paths and runner environment. When a cache is saved on the host runner but restored inside a Docker container, the paths resolve differently (e.g. ~ expands to /home/runner vs /root), causing a version mismatch and cache miss. Adding `enableCrossOsArchive: true` to all cache save/restore steps makes the version hash environment-independent, allowing caches to be shared between host runners and container jobs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5fd99df commit 2c12e4d

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ runs:
2020
with:
2121
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
2222
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
23+
# Required: cache is saved on host but restored inside Docker containers
24+
enableCrossOsArchive: true
2325

2426
- name: Install dependencies
2527
if: steps.cache_dependencies.outputs.cache-hit != 'true'

.github/actions/restore-cache/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ runs:
1515
with:
1616
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
1717
key: ${{ inputs.dependency_cache_key }}
18+
# Required: cache is saved on host but restored inside Docker containers
19+
enableCrossOsArchive: true
1820

1921
- name: Restore build artifacts
2022
uses: actions/download-artifact@v4

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ jobs:
879879
with:
880880
path: ${{ github.workspace }}/packages/*/*.tgz
881881
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
882+
# Required: cache is saved on host but restored inside Docker containers
883+
enableCrossOsArchive: true
882884

883885
- name: Determine which E2E test applications should be run
884886
id: matrix
@@ -961,6 +963,8 @@ jobs:
961963
with:
962964
path: ${{ github.workspace }}/packages/*/*.tgz
963965
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
966+
# Required: cache is saved on host but restored inside Docker containers
967+
enableCrossOsArchive: true
964968

965969
- name: Build tarballs if not cached
966970
if: steps.restore-tarball-cache.outputs.cache-hit != 'true'
@@ -1081,6 +1085,8 @@ jobs:
10811085
with:
10821086
path: ${{ github.workspace }}/packages/*/*.tgz
10831087
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
1088+
# Required: cache is saved on host but restored inside Docker containers
1089+
enableCrossOsArchive: true
10841090

10851091
- name: Build tarballs if not cached
10861092
if: steps.restore-tarball-cache.outputs.cache-hit != 'true'

.github/workflows/canary.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
with:
6060
path: ${{ env.CACHED_BUILD_PATHS }}
6161
key: canary-${{ env.HEAD_COMMIT }}
62+
# Required: cache is saved on host but restored inside Docker containers
63+
enableCrossOsArchive: true
6264
- name: Install dependencies
6365
run: yarn install
6466
- name: Build packages
@@ -163,6 +165,8 @@ jobs:
163165
with:
164166
path: ${{ env.CACHED_BUILD_PATHS }}
165167
key: canary-${{ env.HEAD_COMMIT }}
168+
# Required: cache is saved on host but restored inside Docker containers
169+
enableCrossOsArchive: true
166170

167171
- name: Get node version
168172
id: versions

0 commit comments

Comments
 (0)