Bump androidx.lifecycle:lifecycle-runtime-ktx from 2.8.0 to 2.8.1 #69
Workflow file for this run
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: Android CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test_and_build: | |
name: "Unit tests and Build" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Check build-logic | |
run: ./gradlew check -p build-logic | |
- name: Unit tests | |
run: ./gradlew testDemoDebugUnitTest | |
- name: Build APK | |
run: ./gradlew app:assembleDebug | |
android_test: | |
name: "Android tests and coverage report" | |
runs-on: ubuntu-latest | |
timeout-minutes: 55 | |
strategy: | |
matrix: | |
api-level: [ 23, 33 ] | |
steps: | |
# From https://github.com/android/nowinandroid/pull/1219/files to fix flaky emulator start | |
# Issue https://github.com/ReactiveCircus/android-emulator-runner/issues/324#issuecomment-2009351180 | |
- name: Delete unnecessary tools 🔧 | |
uses: jlumbroso/free-disk-space@v1.3.1 | |
with: | |
android: false # Don't remove Android tools | |
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY" | |
dotnet: true # rm -rf /usr/share/dotnet | |
haskell: true # rm -rf /opt/ghc... | |
swap-storage: true # rm -f /mnt/swapfile (4GiB) | |
docker-images: false # Takes 16s, enable if needed in the future | |
large-packages: false # includes google-cloud-sdk and it's slow | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Enable KVM group perms | |
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 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Gradle cache | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Build project before running emulator | |
run: ./gradlew packageDemoDebug packageDemoDebugAndroidTest | |
- name: Run android tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
disable-animations: true | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disk-size: 6000M | |
heap-size: 600M | |
script: ./gradlew connectedDemoDebugAndroidTest | |
- name: Run unit tests for coverage report | |
if: matrix.api-level == 33 | |
run: ./gradlew testDemoDebugUnitTest | |
- name: Generate JaCoCo coverage report | |
if: matrix.api-level == 33 | |
run: ./gradlew createDemoDebugJacocoReport | |
- name: Display local test coverage (only API 33) | |
if: matrix.api-level == 33 | |
id: jacoco | |
uses: madrapps/jacoco-report@v1.6.1 | |
with: | |
title: Combined test coverage report | |
min-coverage-overall: 40 | |
min-coverage-changed-files: 60 | |
paths: | | |
${{ github.workspace }}/**/build/reports/jacoco/**/*Report.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload local coverage reports (only API 33) | |
if: matrix.api-level == 33 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-reports | |
if-no-files-found: error | |
compression-level: 1 | |
overwrite: false | |
path: '**/build/reports/jacoco/' | |
- name: Upload test reports | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-reports-${{ matrix.api-level }} | |
path: '**/build/reports/androidTests' |