test: bump various test sdk dependencies #628
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: Tests | |
on: | |
push: | |
branches: [ main, beta, alpha ] | |
pull_request: | |
jobs: | |
buildtest: | |
name: Build & Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Prepare gradle environment | |
run: | | |
mkdir -p ~/.gradle | |
rm -f ~/.gradle/gradle.properties | |
touch ~/.gradle/gradle.properties | |
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties | |
- name: Build with Gradle | |
run: ./gradlew build test | |
- uses: actions/upload-artifact@v3 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: unittest-results | |
path: "**/test-results/**/*.xml" # Path to test results | |
instrumentedTests: | |
name: Instrumented Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
api-level: [30] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Gradle cache | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Prepare gradle environment | |
run: | | |
mkdir -p ~/.gradle | |
rm -f ~/.gradle/gradle.properties | |
touch ~/.gradle/gradle.properties | |
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties | |
- name: Enable KVM for Android Emulator | |
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: AVD cache | |
uses: actions/cache@v4 | |
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: | |
arch: 'x86_64' | |
api-level: ${{ matrix.api-level }} | |
force-avd-creation: false | |
emulator-options: -no-window -no-metrics -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run connected tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
arch: 'x86_64' | |
api-level: ${{ matrix.api-level }} | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-metrics -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: ./gradlew connectedAndroidTest | |
- uses: actions/upload-artifact@v3 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: instrumentationtest-results | |
path: "**/androidTest-results/**/*.xml" # Path to test results |