Skip to content

Commit fe418ab

Browse files
committed
fix: unpack ccache on prefix hit; restore on cpu-runner too
- Unpack: replace cache-hit=='true' gate with a file-existence check. actions/cache outputs cache-hit=false on restore-keys prefix hits even though the cache IS downloaded, so the old condition skipped unpacking and every build ran fully cold despite downloading 1.2GB. - Restore: match all ephemeral ARC runners by excluding VM name prefix (iZ0x) instead of only gpu-runner-*, which missed cpu-runner-* pods.
1 parent 0a25b1d commit fe418ab

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

.github/workflows/cuda.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
5555
- name: Restore ccache
5656
id: ccache
57-
if: startsWith(runner.name, 'gpu-runner-')
57+
if: ${{ !startsWith(runner.name, 'iZ0x') }}
5858
uses: actions/cache/restore@v4
5959
with:
6060
path: /tmp/ccache.tar.zst
@@ -63,11 +63,12 @@ jobs:
6363
ccache-cuda-
6464
6565
- name: Unpack ccache
66-
if: steps.ccache.outputs.cache-hit == 'true'
6766
run: |
68-
sudo mkdir -p /github/home/.ccache
69-
sudo tar -I zstd -xf /tmp/ccache.tar.zst -C /github/home
70-
sudo chown -R $(whoami) /github/home/.ccache
67+
if [ -f /tmp/ccache.tar.zst ]; then
68+
sudo mkdir -p /github/home/.ccache
69+
sudo tar -I zstd -xf /tmp/ccache.tar.zst -C /github/home
70+
sudo chown -R $(whoami) /github/home/.ccache
71+
fi
7172
7273
- name: ccache stats (before build)
7374
run: |

.github/workflows/test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
6969
- name: Restore ccache
7070
id: ccache
71-
if: startsWith(runner.name, 'gpu-runner-')
71+
if: ${{ !startsWith(runner.name, 'iZ0x') }}
7272
uses: actions/cache/restore@v4
7373
with:
7474
path: /tmp/ccache.tar.zst
@@ -77,11 +77,12 @@ jobs:
7777
ccache-gnu-
7878
7979
- name: Unpack ccache
80-
if: steps.ccache.outputs.cache-hit == 'true'
8180
run: |
82-
sudo mkdir -p /github/home/.ccache
83-
sudo tar -I zstd -xf /tmp/ccache.tar.zst -C /github/home
84-
sudo chown -R $(whoami) /github/home/.ccache
81+
if [ -f /tmp/ccache.tar.zst ]; then
82+
sudo mkdir -p /github/home/.ccache
83+
sudo tar -I zstd -xf /tmp/ccache.tar.zst -C /github/home
84+
sudo chown -R $(whoami) /github/home/.ccache
85+
fi
8586
8687
- name: ccache stats (before build)
8788
run: |

0 commit comments

Comments
 (0)