Skip to content

Commit 9f8ef4d

Browse files
[WASM] Update cache strategy using timestamp
1 parent 0a0215b commit 9f8ef4d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,18 @@ jobs:
2828
- uses: actions/checkout@v1
2929
with:
3030
path: swift
31+
- name: Prepare sccache timestamp
32+
id: cache_timestamp
33+
shell: cmake -P {0}
34+
run: |
35+
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
36+
message("::set-output name=timestamp::${current_date}")
3137
- uses: actions/cache@v1
3238
with:
3339
path: ../build-cache
34-
key: ${{ runner.os }}-sccache-v7-5.3
40+
key: ${{ runner.os }}-sccache-v10-5.3-${{ steps.cache_timestamp.outputs.timestamp }}
41+
restore-keys: |
42+
${{ runner.os }}-sccache-v10-5.3-
3543
- name: Build Linux installable archive
3644
run: |
3745
./utils/webassembly/ci.sh
@@ -58,10 +66,18 @@ jobs:
5866
- uses: actions/checkout@v1
5967
with:
6068
path: swift
69+
- name: Prepare sccache timestamp
70+
id: cache_timestamp
71+
shell: cmake -P {0}
72+
run: |
73+
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
74+
message("::set-output name=timestamp::${current_date}")
6175
- uses: actions/cache@v1
6276
with:
6377
path: ../build-cache
64-
key: ${{ runner.os }}-sccache-v7-5.3
78+
key: ${{ runner.os }}-sccache-v10-5.3-${{ steps.cache_timestamp.outputs.timestamp }}
79+
restore-keys: |
80+
${{ runner.os }}-sccache-v10-5.3-
6581
- name: Build macOS installable archive
6682
run: |
6783
sudo xcode-select --switch /Applications/Xcode_12_beta.app/Contents/Developer/

0 commit comments

Comments
 (0)