Skip to content

Commit

Permalink
🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon committed Sep 3, 2024
1 parent ee4a1ce commit c6f7be5
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
name: Test iOS build
on:
pull_request:
paths:
- 'package/ios/**'
- 'package/cpp/**'
- 'example/package.json'
- '.github/workflows/**'
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: macos-latest
env:
TURBO_CACHE_DIR: .turbo/ios
strategy:
matrix:
working-directory: [apps/paper, apps/fabric]
Expand All @@ -29,28 +26,44 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Restore Pods from cache
- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
path: |
${{ matrix.working-directory }}/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }}

- name: Install Pods
working-directory: ${{ matrix.working-directory }}/ios
run: pod install
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")
- name: Restore build artifacts from cache
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:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-ios-derived-data-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }}

- name: Build app
working-directory: ${{ matrix.working-directory }}
run: CI=true yarn ios --simulator 'iPhone 14 Pro'
path: |
**/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('./apps/paper/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-
- name: Install cocoapods
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd apps/paper/ios
pod install
env:
NO_FLIPPER: 1

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
# - name: Run e2e tests
# working-directory: package
Expand Down

0 comments on commit c6f7be5

Please sign in to comment.