Skip to content

feat: Add FillWithCrop option, refactor camera preview aspect ratio m… #381

feat: Add FillWithCrop option, refactor camera preview aspect ratio m…

feat: Add FillWithCrop option, refactor camera preview aspect ratio m… #381

Workflow file for this run

name: Test
on:
push:
branches:
- '*'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [21, 29]
steps:
- name: Checkout
uses: actions/checkout@v4
- 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: Set up environment
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- 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 unit tests
run: ./gradlew check
- name: Run integration 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: adb uninstall com.enioka.scanner.sdk.mock.test; adb uninstall com.enioka.scanner.service; ./gradlew connectedCheck --stacktrace
- name: Upload stacktrace
if: always()
uses: actions/upload-artifact@v2
with:
name: stacktrace
path: /home/runner/work/enioka_scan/enioka_scan/enioka_scan/build/reports/androidTests/connected/debug/