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 }}