Skip to content

Commit

Permalink
Disable turborepo cache (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Oct 1, 2024
1 parent f4db230 commit fe24c03
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,13 @@ jobs:
restore-keys: |
${{ runner.os }}-turborepo-android
- name: Check turborepo cache for Android
run: |
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")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi
- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

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

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
Expand All @@ -141,7 +130,6 @@ jobs:
echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties
- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -180,25 +168,13 @@ jobs:
restore-keys: |
${{ runner.os }}-turborepo-android
- name: Check turborepo cache for Android
run: |
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")
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")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
echo "turbo_hash=$TURBO_HASH" >> $GITHUB_ENV
fi
- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

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

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
Expand All @@ -218,7 +193,6 @@ jobs:
echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/fabric/android/local.properties
- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
Expand All @@ -235,13 +209,12 @@ jobs:
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --concurrency 1
- name: Cache apk
if: env.turbo_cache_hit != 1
uses: actions/cache/save@v3
env:
cache-name: cache-apk
with:
path: apps/paper/android/app/build/outputs/apk/debug/app-debug.apk
key: apk-${{ env.turbo_hash }}
key: apk-${{ github.sha }}

test-android:
needs: build-android
Expand All @@ -262,20 +235,12 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Check turborepo cache for Android
run: |
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")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_hash=$TURBO_HASH" >> $GITHUB_ENV
fi
- name: Restore APK
id: cache-apk
uses: actions/cache/restore@v3
with:
path: ${{ matrix.working-directory }}/android/app/build/outputs/apk/debug/app-debug.apk
key: apk-${{ env.turbo_hash }}
key: apk-${{ github.sha }}

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

0 comments on commit fe24c03

Please sign in to comment.