From 0dbb212d133123f43aaba0646543679bbb1d76b1 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Wed, 6 Jan 2021 16:32:33 +0100 Subject: [PATCH] Add instrumented tests to CI workflow --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3ea00e03..7d1218c93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,12 +5,12 @@ on: branches: - dev push: - branches: + branches: - dev - master jobs: - build-and-test: + build-and-test-jvm: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -32,7 +32,7 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - - name: Build debug APK and run Tests + - name: Build debug APK and run jvm tests run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace - name: Upload APK @@ -40,6 +40,31 @@ jobs: with: name: app path: app/build/outputs/apk/debug/*.apk + test-android: + runs-on: macos-latest + strategy: + matrix: + api-level: [21, 29] + steps: + - uses: actions/checkout@v2 + + - name: set up JDK 1.8 + uses: actions/setup-java@v1.4.3 + with: + java-version: 1.8 + + - name: Cache Gradle dependencies + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + + - name: Run android tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + script: ./gradlew connectedCheck # sonar: # runs-on: ubuntu-latest # steps: