summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/ios.yml
blob: 54edb6d9554ac2ae5be18b644f7136fa56b815cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: iOS app CI
on:
    push:
        paths:
            - .github/workflows/ios.yml
            - ios/**
    # Build if requested manually from the Actions tab
    workflow_dispatch:
jobs:
    test:
        name: Unit tests
        runs-on: macos-11
        strategy:
            matrix:
                destination: ['platform=iOS Simulator,OS=13.7,name=iPhone 8']
        env:
            source_packages_dir: .spm
        steps:
            - name: Checkout repository
              uses: actions/checkout@v2

            - name: Configure cache
              uses: actions/cache@v2
              with:
                path: ios/${{ env.source_packages_dir }}
                key: ${{ runner.os }}-spm-${{ hashFiles('ios/**/Package.resolved') }}
                restore-keys: |
                  ${{ runner.os }}-spm-

            - name: Setup go-lang
              uses: actions/setup-go@v2
              with:
                  go-version: '1.16.5'

            - name: Prepare iOS simulator
              run: |
                  sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
                  sudo ln -s /Applications/Xcode_11.7.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 13.7.simruntime

            - name: Build and test
              run: |
                  xcodebuild test \
                      -quiet \
                      -project MullvadVPN.xcodeproj \
                      -scheme MullvadVPNTests \
                      -destination "${destination}" \
                      -clonedSourcePackagesDirPath "${SOURCE_PACKAGES_PATH}" \
                      CODE_SIGN_IDENTITY="" \
                      CODE_SIGNING_REQUIRED=NO \
                      ONLY_ACTIVE_ARCH=YES
              working-directory: ios
              env:
                  destination: ${{ matrix.destination }}
                  SOURCE_PACKAGES_PATH: ${{ env.source_packages_dir }}