Skip to content

Commit 7e94798

Browse files
committed
Replace hashFiles() with github.sha for cache keys
- hashFiles() is failing on GitHub Actions runners - Use github.sha which is reliable and unique per commit - Still maintains restore-keys for cache reuse between builds - This should fix all CI cache-related failures
1 parent c59da56 commit 7e94798

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
uses: actions/cache@v4
3232
with:
3333
path: .build
34-
key: macos-swift62-spm-${{ hashFiles('**/Package.swift') }}
34+
key: ${{ runner.os }}-swift62-spm-${{ github.sha }}
3535
restore-keys: |
36-
macos-swift62-spm-
36+
${{ runner.os }}-swift62-spm-
3737
3838
# Note: swift test builds automatically, no separate build step needed
3939
- name: Test
@@ -69,8 +69,8 @@ jobs:
6969
uses: actions/cache@v4
7070
with:
7171
path: .build
72-
key: linux-swift62-spm-${{ hashFiles('**/Package.swift') }}
73-
restore-keys: linux-swift62-spm-
72+
key: ${{ runner.os }}-swift62-spm-${{ github.sha }}
73+
restore-keys: ${{ runner.os }}-swift62-spm-
7474

7575
# Note: swift test builds automatically in release mode
7676
- name: Test (release)
@@ -89,8 +89,8 @@ jobs:
8989
uses: actions/cache@v4
9090
with:
9191
path: .build
92-
key: linux-swift62-compat-spm-${{ hashFiles('**/Package.swift') }}
93-
restore-keys: linux-swift62-compat-spm-
92+
key: ${{ runner.os }}-swift62-compat-spm-${{ github.sha }}
93+
restore-keys: ${{ runner.os }}-swift62-compat-spm-
9494

9595
# Note: swift test builds automatically
9696
- name: Test (Swift 6.2)

0 commit comments

Comments
 (0)