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