ci: npm release #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pull Request Validation | |
| on: | |
| pull_request: | |
| branches: [dev, main] | |
| jobs: | |
| lint: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5.0.0 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Install ktlint & swiftlint | |
| run: | | |
| brew install ktlint | |
| brew install swiftlint | |
| - name: Lint files | |
| run: yarn lint | |
| - name: Typecheck files | |
| run: yarn typecheck | |
| test: | |
| runs-on: macos-latest | |
| needs: [lint] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5.0.0 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Run unit tests | |
| run: yarn test --maxWorkers=2 --coverage | |
| build-android: | |
| runs-on: macos-latest | |
| needs: [lint, test] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5.0.0 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Generate nitrogen code | |
| run: yarn nitrogen | |
| - name: Install JDK | |
| uses: actions/setup-java@v5.0.0 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Finalize Android SDK | |
| run: | | |
| /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" | |
| - name: Cache Gradle | |
| uses: actions/cache@v4.2.4 | |
| with: | |
| path: | | |
| ~/.gradle/wrapper | |
| ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Create secrets.properties | |
| run: | | |
| echo MAPS_API_KEY="API_KEY" >> example/android/secrets.properties | |
| - name: Build example for Android | |
| env: | |
| JAVA_OPTS: '-XX:MaxHeapSize=6g' | |
| run: yarn build:android | |
| build-ios: | |
| runs-on: macos-latest | |
| needs: [lint, test] | |
| env: | |
| XCODE_VERSION: latest-stable | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5.0.0 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Generate nitrogen code | |
| run: yarn nitrogen | |
| - name: Use appropriate Xcode version | |
| uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: ${{ env.XCODE_VERSION }} | |
| - name: Cache Pods | |
| id: pods-cache | |
| uses: actions/cache@v4.2.4 | |
| with: | |
| path: example/ios/Pods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock')}} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Install cocoapods | |
| if: steps.pods-cache.outputs.cache-hit != 'true' | |
| working-directory: example | |
| run: yarn ios:pods | |
| - name: Create Secrets.xcconfig | |
| run: echo MAPS_API_KEY="API_KEY" >> example/ios/Secrets.xcconfig | |
| - name: Build example for iOS | |
| run: yarn build:ios |