xref: /expo/.github/workflows/ios-unit-tests.yml (revision 2f97575e)
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          ios-pods: 'true'
67          bare-expo-pods: 'true'
68      - name: �� Yarn install
69        if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
70        run: yarn install --frozen-lockfile
71      - name: �� Generating dynamic macros
72        run: expotools ios-generate-dynamic-macros
73      - name: �� Install CocoaPods in `ios`
74        if: steps.expo-caches.outputs.ios-pods-hit != 'true'
75        run: pod install
76        working-directory: ios
77      - name: �� Install CocoaPods in `apps/bare-expo/ios`
78        if: steps.expo-caches.outputs.bare-expo-pods-hit != 'true'
79        run: pod install
80        working-directory: apps/bare-expo/ios
81      - name: �� Run native iOS unit tests
82        timeout-minutes: 45
83        run: expotools native-unit-tests --platform ios
84