xref: /expo/.github/workflows/ios-unit-tests.yml (revision f2369006)
1name: iOS Unit Tests
2
3on:
4  workflow_dispatch: {}
5  pull_request:
6    paths:
7      - .github/workflows/ios-unit-tests.yml
8      - ios/**
9      - packages/**/ios/**
10      - tools/src/dynamic-macros/**
11      - tools/src/commands/IosGenerateDynamicMacros.ts
12      - tools/src/commands/IosNativeUnitTests.ts
13      - tools/src/commands/NativeUnitTests.ts
14      - secrets/**
15      - fastlane/**
16      - Gemfile.lock
17      - '!packages/@expo/cli/**'
18  push:
19    branches: [main]
20    paths:
21      - .github/workflows/ios-unit-tests.yml
22      - ios/**
23      - packages/**/ios/**
24      - tools/src/dynamic-macros/**
25      - tools/src/commands/IosGenerateDynamicMacros.ts
26      - tools/src/commands/IosNativeUnitTests.ts
27      - tools/src/commands/NativeUnitTests.ts
28      - secrets/**
29      - fastlane/**
30      - Gemfile.lock
31      - '!packages/@expo/cli/**'
32
33concurrency:
34  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
35  cancel-in-progress: true
36
37jobs:
38  build:
39    runs-on: macos-13
40    timeout-minutes: 75
41    steps:
42      - name: �� Checkout
43        uses: actions/checkout@v3
44        with:
45          submodules: true
46      - name: �� Switch to Xcode 14.3
47        run: sudo xcode-select --switch /Applications/Xcode_14.3.app
48      - name: �� Decrypt secrets if possible
49        uses: ./.github/actions/expo-git-decrypt
50        with:
51          key: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
52      - name: ➕ Add `bin` to GITHUB_PATH
53        run: echo "$(pwd)/bin" >> $GITHUB_PATH
54      - name: �� Setup Ruby and install gems
55        uses: ruby/setup-ruby@v1
56        with:
57          bundler-cache: true
58          ruby-version: 3.2.2
59      - name: ♻️ Restore caches
60        uses: ./.github/actions/expo-caches
61        id: expo-caches
62        with:
63          yarn-workspace: 'true'
64          yarn-tools: 'true'
65          native-tests-pods: 'true'
66      - name: �� Yarn install
67        if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
68        run: yarn install --frozen-lockfile
69      - name: �� Install CocoaPods in `apps/native-tests/ios`
70        if: steps.expo-caches.outputs.bare-expo-pods-hit != 'true'
71        run: pod install
72        working-directory: apps/native-tests/ios
73      - name: �� Run native iOS unit tests
74        timeout-minutes: 60
75        env:
76          FASTLANE_SKIP_UPDATE_CHECK: '1'
77          FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 30
78          FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 8
79        run: expotools native-unit-tests --platform ios
80