Skip to content

Use ubuntu on CI

Use ubuntu on CI #407

Workflow file for this run

name: 'Test Lib'
on:
pull_request:
push:
branches:
- main
permissions:
checks: write
jobs:
unitTest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/jdks
key: gradle-caches-unit-test-v0-${{ hashFiles('gradle/libs.versions.toml', '**/build.gradle.kts', 'build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Run unit tests
run: ./gradlew :core:testDebugUnitTest
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
with:
check_name: Unit Test Report
report_paths: 'core/build/test-results/testDebugUnitTest/TEST-*.xml'
assembleLibrary:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/jdks
key: gradle-caches-unit-test-v0-${{ hashFiles('gradle/libs.versions.toml', '**/build.gradle.kts', 'build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Assemble library
run: ./gradlew assembleDebug
instrumentationTest:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/jdks
key: gradle-caches-instrumentation-test-v0-${{ hashFiles('gradle/libs.versions.toml', '**/build.gradle.kts', 'build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- 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
- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
emulator-boot-timeout: 12000
script: ./gradlew :core:connectedAndroidTest
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
with:
check_name: Instrumentation Test Report
report_paths: 'core/build/outputs/androidTest-results/connected/debug/TEST-*.xml'