Skip to content

Commit

Permalink
chore: remove turborepo
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Sep 4, 2023
1 parent 3e4d52e commit 2daabe2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 121 deletions.
46 changes: 13 additions & 33 deletions .github/workflows/build-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,16 @@ jobs:
type: module-new
language: cpp

- os: ubuntu
image: reactnativecommunity/react-native-android
- os: macos
image: macos-latest

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}
cancel-in-progress: true

runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.image }}

steps:
- name: Checkout
Expand Down Expand Up @@ -151,31 +156,6 @@ jobs:
fi
fi
- name: Cache turborepo
if: env.android_build == 1 || env.ios_build == 1
uses: actions/cache@v3
with:
path: |
${{ env.work_dir }}/.turbo
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ hashFiles(format('{0}/**/yarn.lock', env.work_dir)) }}
restore-keys: |
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-
- name: Check turborepo cache
if: env.android_build == 1 || env.ios_build == 1
working-directory: ${{ env.work_dir }}
run: |
TURBO_CACHE_STATUS_ANDROID=$(node -p "($(yarn turbo run build:android --cache-dir=".turbo" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
TURBO_CACHE_STATUS_IOS=$(node -p "($(yarn turbo run build:ios --cache-dir=".turbo" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
if [[ $TURBO_CACHE_STATUS_ANDROID == "HIT" ]]; then
echo "turbo_cache_hit_android=1" >> $GITHUB_ENV
fi
if [[ $TURBO_CACHE_STATUS_IOS == "HIT" ]]; then
echo "turbo_cache_hit_ios=1" >> $GITHUB_ENV
fi
- name: Lint library
working-directory: ${{ env.work_dir }}
run: |
Expand Down Expand Up @@ -203,19 +183,19 @@ jobs:
yarn example expo export:web
- name: Install JDK
if: env.android_build == 1 && env.turbo_cache_hit_android != 1
if: env.android_build == 1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Finalize Android SDK
if: env.android_build == 1 && env.turbo_cache_hit_android != 1
if: env.android_build == 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Cache Gradle
if: env.android_build == 1 && env.turbo_cache_hit_android != 1
if: env.android_build == 1
uses: actions/cache@v3
with:
path: |
Expand All @@ -229,10 +209,10 @@ jobs:
if: env.android_build == 1
working-directory: ${{ env.work_dir }}
run: |
yarn turbo run build:android --cache-dir=".turbo"
yarn example build:android
- name: Cache cocoapods
if: env.ios_build == 1 && env.turbo_cache_hit_ios != 1
if: env.ios_build == 1
id: library-cocoapods-cache
uses: actions/cache@v3
with:
Expand All @@ -245,7 +225,7 @@ jobs:
${{ runner.os }}-library-cocoapods-
- name: Install cocoapods
if: env.ios_build == 1 && env.turbo_cache_hit_ios != 1 && steps.library-cocoapods-cache.outputs.cache-hit != 'true'
if: env.ios_build == 1 && steps.library-cocoapods-cache.outputs.cache-hit != 'true'
working-directory: ${{ env.work_dir }}
run: |
yarn example pods
Expand All @@ -256,4 +236,4 @@ jobs:
if: env.ios_build == 1
working-directory: ${{ env.work_dir }}
run: |
yarn turbo run build:ios --cache-dir=".turbo"
yarn example build:ios
Original file line number Diff line number Diff line change
Expand Up @@ -49,46 +49,15 @@ jobs:

<% if (project.native) { -%>
build-android:
runs-on: ubuntu-latest
env:
TURBO_CACHE_DIR: .turbo/android
runs-on: reactnativecommunity/react-native-android
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for Android
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
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: '11'

- 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"
- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
Expand All @@ -100,7 +69,7 @@ jobs:
- name: Build example for Android
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn example build:android
build-ios:
runs-on: macos-latest
Expand All @@ -113,24 +82,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-
- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi
- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
uses: actions/cache@v3
with:
Expand All @@ -141,15 +93,15 @@ jobs:
${{ runner.os }}-cocoapods-
- name: Install cocoapods
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
yarn example pods
env:
NO_FLIPPER: 1

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn example build:ios
<% } else { -%>
build-web:
runs-on: ubuntu-latest
Expand Down

This file was deleted.

0 comments on commit 2daabe2

Please sign in to comment.