Skip to content

Commit 6446814

Browse files
ci: always store sccache
1 parent 817153a commit 6446814

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ jobs:
192192
env:
193193
TOOLCHAIN_CHANNEL: DEVELOPMENT
194194
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer/
195+
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
196+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30
195197
needs: [build-matrix]
196198
if: ${{ always() }}
197199
strategy:
@@ -233,20 +235,19 @@ jobs:
233235
fetch-depth: 0
234236

235237
- name: Prepare sccache timestamp
236-
id: cache_timestamp
238+
id: cache_key
237239
run: |
238-
echo "::set-output name=timestamp::$(date +'%Y-%m-%d-%I-%M-%S')"
240+
echo "SCCACHE_KEY=${{ matrix.target }}-sccache-v13-$(date +'%Y-%m-%d-%I-%M-%S')" >> $GITHUB_OUTPUT
239241
240242
- name: Check Xcode version
241243
if: ${{ startsWith(matrix.build_os, 'macos-') }}
242244
run: |
243245
xcodebuild -version
244246
245-
- uses: actions/cache@v3
246-
timeout-minutes: 30
247+
- uses: actions/cache/restore@v3
247248
with:
248249
path: build-cache
249-
key: ${{ matrix.target }}-sccache-v13-${{ steps.cache_timestamp.outputs.timestamp }}
250+
key: ${{ steps.cache_key.outputs.SCCACHE_KEY }}
250251
restore-keys: |
251252
${{ matrix.target }}-sccache-v13-
252253
@@ -276,6 +277,11 @@ jobs:
276277
277278
- name: Check cache hit rate
278279
run: sccache --show-stats
280+
- uses: actions/cache/save@v3
281+
if: ${{ always() }}
282+
with:
283+
path: build-cache
284+
key: ${{ steps.cache_key.outputs.SCCACHE_KEY }}
279285

280286
- name: Upload ${{ matrix.target }} installable archive
281287
uses: actions/upload-artifact@v1

0 commit comments

Comments
 (0)