Skip to content

Commit fe24c03

Browse files
authored
Disable turborepo cache (#2673)
1 parent f4db230 commit fe24c03

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

.github/workflows/ci.yml

+2-37
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,13 @@ jobs:
106106
restore-keys: |
107107
${{ runner.os }}-turborepo-android
108108
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-
117109
- name: Install JDK
118-
if: env.turbo_cache_hit != 1
119110
uses: actions/setup-java@v3
120111
with:
121112
distribution: 'zulu'
122113
java-version: '17'
123114

124115
- name: Install NDK
125-
if: env.turbo_cache_hit != 1
126116
uses: nttld/setup-ndk@v1
127117
id: setup-ndk
128118
with:
@@ -132,7 +122,6 @@ jobs:
132122
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
133123

134124
- name: Finalize Android SDK
135-
if: env.turbo_cache_hit != 1
136125
run: |
137126
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
138127
@@ -141,7 +130,6 @@ jobs:
141130
echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties
142131
143132
- name: Cache Gradle
144-
if: env.turbo_cache_hit != 1
145133
uses: actions/cache@v3
146134
with:
147135
path: |
@@ -180,25 +168,13 @@ jobs:
180168
restore-keys: |
181169
${{ runner.os }}-turborepo-android
182170
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-
193171
- name: Install JDK
194-
if: env.turbo_cache_hit != 1
195172
uses: actions/setup-java@v3
196173
with:
197174
distribution: 'zulu'
198175
java-version: '17'
199176

200177
- name: Install NDK
201-
if: env.turbo_cache_hit != 1
202178
uses: nttld/setup-ndk@v1
203179
id: setup-ndk
204180
with:
@@ -208,7 +184,6 @@ jobs:
208184
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
209185

210186
- name: Finalize Android SDK
211-
if: env.turbo_cache_hit != 1
212187
run: |
213188
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
214189
@@ -218,7 +193,6 @@ jobs:
218193
echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/fabric/android/local.properties
219194
220195
- name: Cache Gradle
221-
if: env.turbo_cache_hit != 1
222196
uses: actions/cache@v3
223197
with:
224198
path: |
@@ -235,13 +209,12 @@ jobs:
235209
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --concurrency 1
236210
237211
- name: Cache apk
238-
if: env.turbo_cache_hit != 1
239212
uses: actions/cache/save@v3
240213
env:
241214
cache-name: cache-apk
242215
with:
243216
path: apps/paper/android/app/build/outputs/apk/debug/app-debug.apk
244-
key: apk-${{ env.turbo_hash }}
217+
key: apk-${{ github.sha }}
245218

246219
test-android:
247220
needs: build-android
@@ -262,20 +235,12 @@ jobs:
262235
with:
263236
github_token: ${{ secrets.GITHUB_TOKEN }}
264237

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-
273238
- name: Restore APK
274239
id: cache-apk
275240
uses: actions/cache/restore@v3
276241
with:
277242
path: ${{ matrix.working-directory }}/android/app/build/outputs/apk/debug/app-debug.apk
278-
key: apk-${{ env.turbo_hash }}
243+
key: apk-${{ github.sha }}
279244

280245
- name: SKDs - download required images
281246
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;default;x86_64"

0 commit comments

Comments
 (0)