Merge pull request #3641 from kiwix/Issue#3640 #1358
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
automated-tests: | |
name: Automated tests | |
strategy: | |
matrix: | |
api-level: [ 24, 30, 33 ] | |
fail-fast: false | |
runs-on: macos-11 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Restore Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: create instrumentation coverage | |
uses: ReactiveCircus/android-emulator-runner@v2 | |
env: | |
GRADLE_OPTS: "-Dorg.gradle.internal.http.connectionTimeout=60000 -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.network.retry.max.attempts=6 -Dorg.gradle.internal.network.retry.initial.backOff=2000" | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.api-level != 33 && 'default' || 'google_apis' }} | |
arch: x86_64 | |
profile: pixel_2 | |
ram-size: '4096M' | |
disk-size: '14G' | |
sdcard-path-or-size: ${{ matrix.api-level != 33 && '1000M' || '4096M' }} | |
disable-animations: false | |
heap-size: ${{ matrix.api-level == 33 && '512M' || '' }} | |
script: bash contrib/instrumentation.sh | |
- name: Upload screenshot result | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.api-level }} | |
path: screencap.png | |
- name: create unit coverage | |
if: ${{ matrix.api-level==24 }} | |
run: ./gradlew testDebugUnitTest testCustomexampleDebugUnitTest | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.api-level==24 }} | |
uses: codecov/codecov-action@v3 | |
- name: Upload Coverage to GH-Actions | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.api-level==24 }} | |
with: | |
name: Tests Coverage Report | |
path: | | |
**/reports/ |