Skip to content

hotfix(refactor): remove initialization module and update workflow #1

hotfix(refactor): remove initialization module and update workflow

hotfix(refactor): remove initialization module and update workflow #1

name: android-instrumented-test
on:
push:
branches: [ develop ]
pull_request:
branches:
- develop
paths-ignore:
- "app/src/main/**"
permissions:
checks: write
jobs:
instrumented:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
api-level: [23, 34]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- uses: gradle/actions/setup-gradle@v3
- uses: gradle/wrapper-validation-action@v3
- name: Enable KVM
continue-on-error: true
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: Gradle cache
uses: gradle/actions/setup-gradle@v3
- 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:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedCheck
- name: Publish Integrated Test Report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/androidTest-results/**/TEST-*.xml'