name: iOS Unit Tests on: workflow_dispatch: {} pull_request: paths: - .github/workflows/ios-unit-tests.yml - ios/** - packages/**/ios/** - tools/src/dynamic-macros/** - tools/src/commands/IosGenerateDynamicMacros.ts - tools/src/commands/IosNativeUnitTests.ts - tools/src/commands/NativeUnitTests.ts - secrets/** - fastlane/** - Gemfile.lock - .ruby-version push: branches: [master] paths: - .github/workflows/ios-unit-tests.yml - ios/** - packages/**/ios/** - tools/src/dynamic-macros/** - tools/src/commands/IosGenerateDynamicMacros.ts - tools/src/commands/IosNativeUnitTests.ts - tools/src/commands/NativeUnitTests.ts - secrets/** - fastlane/** - Gemfile.lock - .ruby-version concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: macos-11 steps: - uses: actions/checkout@v2 with: submodules: true - name: 🔨 Switch to Xcode 13.0 run: sudo xcode-select --switch /Applications/Xcode_13.0.app - run: brew install git-crypt - name: decrypt secrets if possible env: GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }} run: | if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then echo 'git-crypt key not present in environment' else git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode) fi - run: echo "$(pwd)/bin" >> $GITHUB_PATH - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - name: ♻️ Restore yarn cache uses: actions/cache@v2 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: 🧶 Yarn install run: yarn install --frozen-lockfile - name: ♻️ Restore tools/node_modules from cache uses: actions/cache@v2 with: path: 'tools/node_modules' key: ${{ runner.os }}-modules-${{ hashFiles('tools/yarn.lock') }} - run: expotools ios-generate-dynamic-macros - uses: ruby/setup-ruby@v1 with: bundler-cache: true - name: Restore ios/Pods from cache uses: actions/cache@v2 id: pods-cache with: path: 'ios/Pods' key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} # restore-keys: | # ${{ runner.os }}-pods- - name: 🥥 Install CocoaPods in `ios` run: pod install working-directory: ios - name: Run native iOS unit tests run: expotools native-unit-tests --platform ios