Skip to content

#159 Updated strings.xml in values-sv #27

#159 Updated strings.xml in values-sv

#159 Updated strings.xml in values-sv #27

name: Instrumented CI Tests
on:
push:
branches:
- '*'
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [17, 19, 34]
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- 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: Restore Android virtual device
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: pfa-pedometer-${{ runner.os }}-avd-api${{ matrix.api-level }}
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- name: Set up Android virtual device if not cached
uses: reactivecircus/android-emulator-runner@v2
if: steps.avd-cache.outputs.cache-hit != 'true'
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }}
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
sdcard-path-or-size: 64M
script: echo "Generated AVD snapshot for caching."
- name: Run instrumented tests on Android virtual device
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }}
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
sdcard-path-or-size: 64M
script: |
adb uninstall org.secuso.privacyfriendlyactivitytracker.test || true
touch emulator.log # create log file
chmod 777 emulator.log # allow writing to log file
adb logcat >> emulator.log & # pipe all logcat messages into log file as a background process
./gradlew connectedAndroidTest --no-build-cache --no-daemon
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.api-level }}-${{ matrix.arch }}-instrumentation-test-results
path: |
emulator.log
./**/build/reports/androidTests/connected/**