mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Run Instrumentation tests and generates unified code coverage (#4828)
* Run instrumentation tests on CI and generate unified coverage report * Fix ci * Fix failing tests and use mac machine for HAXM * Fix failing tests * Fix coverage failure * Try with ubuntu latest * Change API level to 23 * Fix Failing Test * Add prod APK generator workflow back
This commit is contained in:
parent
c6fda6dadb
commit
9205f37605
16 changed files with 98 additions and 25 deletions
36
.github/workflows/android.yml
vendored
36
.github/workflows/android.yml
vendored
|
|
@ -8,8 +8,11 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: Build APK and Run Unit Tests
|
||||
name: Run tests and generate APK
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
api-level: [23]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
|
|
@ -30,7 +33,36 @@ jobs:
|
|||
key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
|
||||
restore-keys: gradle-packages-${{ runner.os }}
|
||||
|
||||
- name: Build with Gradle and run Unit Tests
|
||||
- name: AVD cache
|
||||
uses: actions/cache@v2
|
||||
id: avd-cache
|
||||
with:
|
||||
path: |
|
||||
~/.android/avd/*
|
||||
~/.android/adb*
|
||||
key: avd-${{ matrix.api-level }}
|
||||
|
||||
- name: Create AVD and generate snapshot for caching
|
||||
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
disable-animations: false
|
||||
script: echo "Generated AVD snapshot for caching."
|
||||
|
||||
- name: Run Instrumentation tests
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
disable-animations: true
|
||||
profile: Nexus 6
|
||||
script: ./gradlew connectedBetaDebugAndroidTest --stacktrace
|
||||
|
||||
- name: Run Unit tests
|
||||
run: ./gradlew -Pcoverage testBetaDebugUnitTestCoverage --stacktrace
|
||||
|
||||
- name: Upload Test Report to Codecov
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue