Skip to content

Commit 0af6375

Browse files
authored
Fix buildcache/ccache for Firestore workflow (#11715)
1 parent 327457a commit 0af6375

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

.github/workflows/firestore.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ concurrency:
2727
jobs:
2828
changes:
2929
runs-on: macos-12
30+
# Only when this is not a scheduled run
31+
if: github.event_name != 'schedule'
3032
outputs:
3133
changed: ${{ steps.changes.outputs.changed }}
3234
steps:
@@ -110,14 +112,11 @@ jobs:
110112
runs-on: ${{ matrix.os }}
111113
steps:
112114
- uses: actions/checkout@v3
113-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
114-
with:
115-
cache_key: ${{ matrix.os }}
116115

117116
- name: Prepare ccache
118117
uses: actions/cache@v3
119118
with:
120-
path: ~/.ccache
119+
path: ${{ runner.temp }}/ccache
121120
key: firestore-ccache-${{ runner.os }}-${{ github.sha }}
122121
restore-keys: |
123122
firestore-ccache-${{ runner.os }}-
@@ -133,7 +132,9 @@ jobs:
133132
run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
134133

135134
- name: Build and test
136-
run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
135+
run: |
136+
export CCACHE_DIR=${{ runner.temp }}/ccache
137+
scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
137138
138139
139140
cmake-prod-db:
@@ -156,17 +157,14 @@ jobs:
156157
runs-on: ${{ matrix.os }}
157158
steps:
158159
- uses: actions/checkout@v3
159-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
160-
with:
161-
cache_key: ${{ matrix.os }}
162160

163161
- name: Prepare ccache
164162
uses: actions/cache@v3
165163
with:
166-
path: ~/.ccache
167-
key: firestore-ccache-${{ runner.os }}-${{ github.sha }}
164+
path: ${{ runner.temp }}/ccache
165+
key: firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}-${{ github.sha }}
168166
restore-keys: |
169-
firestore-ccache-${{ runner.os }}-
167+
firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}-
170168
171169
- name: Cache Mint packages
172170
uses: actions/cache@v3
@@ -183,7 +181,9 @@ jobs:
183181
run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
184182

185183
- name: Build and test
186-
run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
184+
run: |
185+
export CCACHE_DIR=${{ runner.temp }}/ccache
186+
scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
187187
188188
189189
sanitizers:
@@ -206,23 +206,22 @@ jobs:
206206

207207
steps:
208208
- uses: actions/checkout@v3
209-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
210-
with:
211-
cache_key: ${{ matrix.os }}
212209

213210
- name: Prepare ccache
214211
uses: actions/cache@v3
215212
with:
216-
path: ~/.ccache
217-
key: firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-${{ github.sha }}
213+
path: ${{ runner.temp }}/ccache
214+
key: ${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}-${{ github.sha }}
218215
restore-keys: |
219-
firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-
216+
${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}-
220217
221218
- name: Setup build
222219
run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
223220

224221
- name: Build and test
225-
run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
222+
run: |
223+
export CCACHE_DIR=${{ runner.temp }}/ccache
224+
scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
226225
227226
228227
xcodebuild:
@@ -241,7 +240,7 @@ jobs:
241240
- uses: actions/checkout@v3
242241
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
243242
with:
244-
cache_key: ${{ matrix.os }}
243+
cache_key: ${{ matrix.target }}
245244

246245
- uses: ruby/setup-ruby@v1
247246

0 commit comments

Comments
 (0)