Build and test #1453
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: Build and test | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["Upgrade all dependencies"] | |
| types: | |
| - completed | |
| env: | |
| android-adb-command-timeout-milliseconds: 20_000L | |
| android-api-level: 34 | |
| android-avd-name: Pixel_3_API_S_1 | |
| android-avd-ram-size: 1024M | |
| android-promise-timeout-milliseconds: 75_000L | |
| android-sdk-root: /Users/ely/Library/Android/sdk | |
| node-version: 22 | |
| jobs: | |
| build-typescript-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: TARGET=typescript make clean build | |
| if: steps.node_modules.outputs.cache-hit != 'true' | |
| build-typescript-macos: | |
| runs-on: m1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: TARGET=typescript make clean build | |
| if: steps.node_modules.outputs.cache-hit != 'true' | |
| build-typescript-lint: | |
| needs: | |
| - build-typescript-linux | |
| - build-typescript-macos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: TARGET=typescript make lint | |
| run-typescript-tests: | |
| needs: build-typescript-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: TARGET=typescript make test | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ts-test-results | |
| path: output/typescript-test-output.xml | |
| run-android-lint: | |
| needs: | |
| - build-typescript-linux | |
| - build-typescript-macos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - run: TARGET=android make clean lint | |
| run-android-unit-tests: | |
| needs: run-android-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - run: TARGET=android:unit make clean test | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-unit-test-results | |
| path: android/build/test-results/**/*.xml | |
| run-android-instrumented-tests: | |
| needs: run-android-lint | |
| continue-on-error: true | |
| runs-on: m1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - uses: reactivecircus/android-emulator-runner@v2.34.0 | |
| env: | |
| ANDROID_SDK_ROOT: ${{ env.android-sdk-root }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ORG_GRADLE_PROJECT_ADB_COMMAND_TIMEOUT_MILLISECONDS: ${{ env.android-adb-command-timeout-milliseconds }} | |
| ORG_GRADLE_PROJECT_PROMISE_TIMEOUT_MILLISECONDS: ${{ env.android-promise-timeout-milliseconds }} | |
| TARGET: android:instrumented | |
| with: | |
| api-level: ${{ env.android-api-level }} | |
| arch: arm64-v8a | |
| avd-name: ${{ env.android-avd-name }} | |
| emulator-options: -no-snapshot -noaudio -no-boot-anim | |
| force-avd-creation: false | |
| ram-size: ${{ env.android-avd-ram-size }} | |
| script: | | |
| adb logcat -c | |
| adb logcat | tee android_instrumented_logcat.log | grep 'io.deckers.blob_courier' & | |
| make clean test | |
| target: google_apis | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-instrumented-test-results | |
| path: android/build/outputs/androidTest-results/connected/**/*.xml | |
| if: always() | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-instrumented-logcat | |
| path: android_instrumented_logcat.log | |
| if: always() | |
| run-ios-lint: | |
| needs: | |
| - build-typescript-linux | |
| - build-typescript-macos | |
| runs-on: m1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - run: TARGET=ios make lint | |
| run-ios-tests: | |
| needs: run-ios-lint | |
| runs-on: m1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: xcrun simctl boot "iPhone 16 Pro" || true | |
| - uses: actions/cache@v4 | |
| id: node_modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| - run: TARGET=ios:gui make clean test | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-test-results | |
| path: build/reports/**/*.xml |