Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 40 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage

build-library:
runs-on: ubuntu-latest
steps:
Expand All @@ -52,45 +49,24 @@ jobs:

build-android:
runs-on: ubuntu-latest
env:
TURBO_CACHE_DIR: .turbo/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: '17'

- 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,62 +76,70 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

- name: Build example for Android
- name: Build Android example (Paper)
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
run: yarn android:paper:build

- name: Build Android example (Fabric)
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: yarn android:fabric:build

build-ios:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
mode: [paper, fabric]
env:
TURBO_CACHE_DIR: .turbo/ios
RCT_NEW_ARCH_ENABLED: ${{ matrix.mode == 'fabric' && '1' || '0' }}
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Cache turborepo for iOS
uses: actions/cache@v3
- name: Select Xcode 16.1
uses: maxim-lobanov/setup-xcode@v1
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-
xcode-version: '16.1'

- 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: Setup
uses: ./.github/actions/setup

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
- name: Cache CocoaPods
id: cocoapods-cache
uses: actions/cache@v3
with:
path: |
**/ios/Pods
**/ios/build/generated/ios
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
example/ios/Pods
example/ios/build/generated/ios
key: ${{ runner.os }}-cocoapods-${{ matrix.mode }}-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-
${{ runner.os }}-cocoapods-${{ matrix.mode }}-

- name: Install cocoapods
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
- name: Install CocoaPods
run: |
cd example/ios
pod install
set -o pipefail
if ! pod install; then
echo "pod install failed; retrying after updating hermes-engine" >&2
pod update hermes-engine --no-repo-update
pod install
fi
env:
NO_FLIPPER: 1

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
- name: Ensure DerivedData directory
run: mkdir -p ~/Library/Developer/Xcode/DerivedData

- name: Cache DerivedData
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData/example-*
key: ${{ runner.os }}-deriveddata-${{ matrix.mode }}-${{ hashFiles('example/ios/Podfile.lock') }}

- name: Build iOS example (${{ matrix.mode }})
run: yarn ios:${{ matrix.mode }}:build

build-web:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ android/keystores/debug.keystore

# Expo
.expo/
expo-example/android/
expo-example/ios/

# Turborepo
.turbo/
Expand Down
Loading