|
| 1 | +name: pull_request.yml |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: [dev, main] |
| 5 | + |
| 6 | +jobs: |
| 7 | + lint: |
| 8 | + runs-on: macos-latest |
| 9 | + steps: |
| 10 | + - name: Checkout |
| 11 | + |
| 12 | + |
| 13 | + - name: Setup |
| 14 | + uses: ./.github/actions/setup |
| 15 | + |
| 16 | + - name: Install ktlint & swiftlint |
| 17 | + run: | |
| 18 | + brew install ktlint |
| 19 | + brew install swiftlint |
| 20 | +
|
| 21 | + - name: Lint files |
| 22 | + run: yarn lint |
| 23 | + |
| 24 | + - name: Typecheck files |
| 25 | + run: yarn typecheck |
| 26 | + |
| 27 | + test: |
| 28 | + runs-on: macos-latest |
| 29 | + needs: [lint] |
| 30 | + steps: |
| 31 | + - name: Checkout |
| 32 | + |
| 33 | + |
| 34 | + - name: Setup |
| 35 | + uses: ./.github/actions/setup |
| 36 | + |
| 37 | + - name: Run unit tests |
| 38 | + run: yarn test --maxWorkers=2 --coverage |
| 39 | + |
| 40 | + build-android: |
| 41 | + runs-on: macos-latest |
| 42 | + needs: [lint, test] |
| 43 | + steps: |
| 44 | + - name: Checkout |
| 45 | + |
| 46 | + |
| 47 | + - name: Setup |
| 48 | + uses: ./.github/actions/setup |
| 49 | + |
| 50 | + - name: Generate nitrogen code |
| 51 | + run: yarn nitrogen |
| 52 | + |
| 53 | + - name: Install JDK |
| 54 | + |
| 55 | + with: |
| 56 | + distribution: 'zulu' |
| 57 | + java-version: '17' |
| 58 | + |
| 59 | + - name: Finalize Android SDK |
| 60 | + run: | |
| 61 | + /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" |
| 62 | +
|
| 63 | + - name: Cache Gradle |
| 64 | + |
| 65 | + with: |
| 66 | + path: | |
| 67 | + ~/.gradle/wrapper |
| 68 | + ~/.gradle/caches |
| 69 | + key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} |
| 70 | + restore-keys: | |
| 71 | + ${{ runner.os }}-gradle- |
| 72 | +
|
| 73 | + - name: Create secrets.properties |
| 74 | + run: | |
| 75 | + echo MAPS_API_KEY="API_KEY" >> example/android/secrets.properties |
| 76 | +
|
| 77 | + - name: Build example for Android |
| 78 | + env: |
| 79 | + JAVA_OPTS: '-XX:MaxHeapSize=6g' |
| 80 | + run: yarn build:android |
| 81 | + build-ios: |
| 82 | + runs-on: macos-latest |
| 83 | + needs: [lint, test] |
| 84 | + env: |
| 85 | + XCODE_VERSION: latest-stable |
| 86 | + steps: |
| 87 | + - name: Checkout |
| 88 | + |
| 89 | + |
| 90 | + - name: Setup |
| 91 | + uses: ./.github/actions/setup |
| 92 | + |
| 93 | + - name: Generate nitrogen code |
| 94 | + run: yarn nitrogen |
| 95 | + |
| 96 | + - name: Use appropriate Xcode version |
| 97 | + uses: maxim-lobanov/[email protected] |
| 98 | + with: |
| 99 | + xcode-version: ${{ env.XCODE_VERSION }} |
| 100 | + |
| 101 | + - name: Cache Pods |
| 102 | + id: pods-cache |
| 103 | + |
| 104 | + with: |
| 105 | + path: example/ios/Pods |
| 106 | + key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock')}} |
| 107 | + restore-keys: | |
| 108 | + ${{ runner.os }}-pods- |
| 109 | +
|
| 110 | + - name: Install cocoapods |
| 111 | + if: steps.pods-cache.outputs.cache-hit != 'true' |
| 112 | + working-directory: example |
| 113 | + run: yarn ios:pods |
| 114 | + |
| 115 | + - name: Create Secrets.xcconfig |
| 116 | + run: echo MAPS_API_KEY="API_KEY" >> example/ios/Secrets.xcconfig |
| 117 | + |
| 118 | + - name: Build example for iOS |
| 119 | + run: yarn build:ios |
0 commit comments