Skip to content

Build and test

Build and test #1318

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: 31
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: 14
jobs:
build-typescript-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
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@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
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@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
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@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ env.node-version }}
- run: TARGET=typescript make test
- uses: actions/upload-artifact@v2
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@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=android make clean lint
run-android-unit-tests:
needs: run-android-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=android:unit make clean test
- uses: actions/upload-artifact@v2
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@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: reactivecircus/android-emulator-runner@v2.21.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@v2
with:
name: android-instrumented-test-results
path: android/build/outputs/androidTest-results/connected/**/*.xml
if: always()
- uses: actions/upload-artifact@v2
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@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=ios make lint
run-ios-tests:
needs: run-ios-lint
runs-on: m1
steps:
- uses: actions/checkout@v2
- run: xcrun simctl boot "iPhone 11" || true
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=ios:gui make clean test
- uses: actions/upload-artifact@v2
with:
name: ios-test-results
path: build/reports/**/*.xml