coverage-test #835
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: coverage-test | |
on: | |
push: | |
branches: | |
- "*" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CACHE_VERSION: 1 | |
jobs: | |
fdroid: | |
name: fdroid | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: true | |
matrix: | |
api-level: [ 24, 34 ] | |
steps: | |
- name: clone | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: true | |
- name: Enable KVM | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- run: ./ci_clear_gradle_cache.sh | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ env.CACHE_VERSION }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/libs.versions.toml') }} | |
- name: Get AVD info | |
uses: ./.github/actions/get-avd-info | |
id: avd-info | |
with: | |
api-level: ${{ matrix.api-level }} | |
- uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: ${{ runner.os }}-avd-${{ env.CACHE_VERSION }}-${{ steps.avd-info.outputs.arch }}-${{ steps.avd-info.outputs.target }}-${{ matrix.api-level }} | |
- name: Create AVD snapshot | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: ${{ steps.avd-info.outputs.arch }} | |
target: ${{ steps.avd-info.outputs.target }} | |
disable-animations: false | |
force-avd-creation: false | |
ram-size: 4096M | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
script: echo "Generated AVD snapshot." | |
- name: local.properties | |
env: | |
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }} | |
LOCAL_PROPERTIES_CLOUDLIB: ${{ secrets.LOCAL_PROPERTIES_CLOUDLIB }} | |
LOCAL_PROPERTIES_UTILSLIB: ${{ secrets.LOCAL_PROPERTIES_UTILSLIB }} | |
run: | | |
echo "${LOCAL_PROPERTIES}" | base64 -d > local.properties | |
echo "${LOCAL_PROPERTIES_CLOUDLIB}" | base64 -d > QuoteUnquote.cloudLib/cloudLib/local.properties | |
echo "${LOCAL_PROPERTIES_UTILSLIB}" | base64 -d > QuoteUnquote.utilsLib/utilsLib/local.properties | |
- name: unitTest | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: ${{ steps.avd-info.outputs.arch }} | |
target: ${{ steps.avd-info.outputs.target }} | |
disable-animations: true | |
force-avd-creation: false | |
ram-size: 4096M | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
script: | | |
adb logcat -c | |
adb logcat > logcat.txt & | |
./gradlew :app:testFdroidDebugUnitTestCoverage --stacktrace | |
- name: artifact logcat | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fdroid-logcat-${{ matrix.api-level }} | |
path: logcat.txt | |
- name: artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fdroid-${{ matrix.api-level }} | |
path: | | |
**/build/reports/* | |
**/build/outputs/*/connected/* | |
- name: publish | |
run: | | |
set -x | |
find . -name "*.exec"; find . -name "*.ec"; find app/build/reports/ -name "*.xml" | |
bash <(curl https://codecov.io/bash) -t ${{ secrets.CODECOVIO_TOKEN }} -f app/build/reports/FdroidDebug.xml -F test.fdroid | |
googleplay: | |
name: googleplay | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: true | |
matrix: | |
api-level: [ 24, 34 ] | |
steps: | |
- name: clone | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: true | |
- name: Enable KVM | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- run: ./ci_clear_gradle_cache.sh | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ env.CACHE_VERSION }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/libs.versions.toml') }} | |
- name: Get AVD info | |
uses: ./.github/actions/get-avd-info | |
id: avd-info | |
with: | |
api-level: ${{ matrix.api-level }} | |
- uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: ${{ runner.os }}-avd-${{ env.CACHE_VERSION }}-${{ steps.avd-info.outputs.arch }}-${{ steps.avd-info.outputs.target }}-${{ matrix.api-level }} | |
- name: Create AVD snapshot | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: ${{ steps.avd-info.outputs.arch }} | |
target: ${{ steps.avd-info.outputs.target }} | |
disable-animations: false | |
force-avd-creation: false | |
ram-size: 4096M | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
script: echo "Generated AVD snapshot." | |
- name: local.properties | |
env: | |
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }} | |
LOCAL_PROPERTIES_CLOUDLIB: ${{ secrets.LOCAL_PROPERTIES_CLOUDLIB }} | |
LOCAL_PROPERTIES_UTILSLIB: ${{ secrets.LOCAL_PROPERTIES_UTILSLIB }} | |
run: | | |
echo "${LOCAL_PROPERTIES}" | base64 -d > local.properties | |
echo "${LOCAL_PROPERTIES_CLOUDLIB}" | base64 -d > QuoteUnquote.cloudLib/cloudLib/local.properties | |
echo "${LOCAL_PROPERTIES_UTILSLIB}" | base64 -d > QuoteUnquote.utilsLib/utilsLib/local.properties | |
- name: google-services.json | |
env: | |
GOOGLE_PLAY_JSON_DEVELOPMENT: ${{ secrets.GOOGLE_PLAY_JSON_DEVELOPMENT }} | |
run: echo "${GOOGLE_PLAY_JSON_DEVELOPMENT}" | base64 -d > app/google-services.json | |
- name: unitTest | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: ${{ steps.avd-info.outputs.arch }} | |
target: ${{ steps.avd-info.outputs.target }} | |
disable-animations: true | |
force-avd-creation: false | |
ram-size: 4096M | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
script: | | |
adb logcat -c | |
adb logcat > logcat.txt & | |
./gradlew :app:testGoogleplayDebugUnitTestCoverage --stacktrace | |
- name: artifact logcat | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: googleplay-logcat-${{ matrix.api-level }} | |
path: logcat.txt | |
- name: artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: googleplay-${{ matrix.api-level }} | |
path: | | |
**/build/reports/* | |
**/build/outputs/*/connected/* | |
- name: publish | |
run: | | |
set -x | |
find . -name "*.exec"; find . -name "*.ec"; find app/build/reports/ -name "*.xml" | |
bash <(curl https://codecov.io/bash) -t ${{ secrets.CODECOVIO_TOKEN }} -f app/build/reports/GoogleplayDebug.xml -F test.googleplay |