@@ -106,23 +106,13 @@ jobs:
106
106
restore-keys : |
107
107
${{ runner.os }}-turborepo-android
108
108
109
- - name : Check turborepo cache for Android
110
- run : |
111
- TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
112
-
113
- if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
114
- echo "turbo_cache_hit=1" >> $GITHUB_ENV
115
- fi
116
-
117
109
- name : Install JDK
118
- if : env.turbo_cache_hit != 1
119
110
uses : actions/setup-java@v3
120
111
with :
121
112
distribution : ' zulu'
122
113
java-version : ' 17'
123
114
124
115
- name : Install NDK
125
- if : env.turbo_cache_hit != 1
126
116
uses : nttld/setup-ndk@v1
127
117
id : setup-ndk
128
118
with :
@@ -132,7 +122,6 @@ jobs:
132
122
run : echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
133
123
134
124
- name : Finalize Android SDK
135
- if : env.turbo_cache_hit != 1
136
125
run : |
137
126
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
138
127
@@ -141,7 +130,6 @@ jobs:
141
130
echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties
142
131
143
132
- name : Cache Gradle
144
- if : env.turbo_cache_hit != 1
145
133
uses : actions/cache@v3
146
134
with :
147
135
path : |
@@ -180,25 +168,13 @@ jobs:
180
168
restore-keys : |
181
169
${{ runner.os }}-turborepo-android
182
170
183
- - name : Check turborepo cache for Android
184
- run : |
185
- TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.taskId === 'paper#build:android').cache.status")
186
- TURBO_HASH=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.taskId === 'paper#build:android').hash")
187
-
188
- if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
189
- echo "turbo_cache_hit=1" >> $GITHUB_ENV
190
- echo "turbo_hash=$TURBO_HASH" >> $GITHUB_ENV
191
- fi
192
-
193
171
- name : Install JDK
194
- if : env.turbo_cache_hit != 1
195
172
uses : actions/setup-java@v3
196
173
with :
197
174
distribution : ' zulu'
198
175
java-version : ' 17'
199
176
200
177
- name : Install NDK
201
- if : env.turbo_cache_hit != 1
202
178
uses : nttld/setup-ndk@v1
203
179
id : setup-ndk
204
180
with :
@@ -208,7 +184,6 @@ jobs:
208
184
run : echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
209
185
210
186
- name : Finalize Android SDK
211
- if : env.turbo_cache_hit != 1
212
187
run : |
213
188
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
214
189
@@ -218,7 +193,6 @@ jobs:
218
193
echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/fabric/android/local.properties
219
194
220
195
- name : Cache Gradle
221
- if : env.turbo_cache_hit != 1
222
196
uses : actions/cache@v3
223
197
with :
224
198
path : |
@@ -235,13 +209,12 @@ jobs:
235
209
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --concurrency 1
236
210
237
211
- name : Cache apk
238
- if : env.turbo_cache_hit != 1
239
212
uses : actions/cache/save@v3
240
213
env :
241
214
cache-name : cache-apk
242
215
with :
243
216
path : apps/paper/android/app/build/outputs/apk/debug/app-debug.apk
244
- key : apk-${{ env.turbo_hash }}
217
+ key : apk-${{ github.sha }}
245
218
246
219
test-android :
247
220
needs : build-android
@@ -262,20 +235,12 @@ jobs:
262
235
with :
263
236
github_token : ${{ secrets.GITHUB_TOKEN }}
264
237
265
- - name : Check turborepo cache for Android
266
- run : |
267
- TURBO_HASH=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.taskId === 'paper#build:android').hash")
268
-
269
- if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
270
- echo "turbo_hash=$TURBO_HASH" >> $GITHUB_ENV
271
- fi
272
-
273
238
- name : Restore APK
274
239
id : cache-apk
275
240
uses : actions/cache/restore@v3
276
241
with :
277
242
path : ${{ matrix.working-directory }}/android/app/build/outputs/apk/debug/app-debug.apk
278
- key : apk-${{ env.turbo_hash }}
243
+ key : apk-${{ github.sha }}
279
244
280
245
- name : SKDs - download required images
281
246
run : $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;default;x86_64"
0 commit comments