Merge pull request #41 from tillhub/feature/UNTIL-12204/s-pos_impleme… #13
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: Android CI - Release | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
basic-tests: | |
name: Run all tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
api-level: [ 30 ] | |
target: [ google_apis ] | |
steps: | |
- name: Checking out branch | |
uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Run Detekt Code Analysis | |
run: ./gradlew detekt | |
- name: Run Unit tests | |
run: ./gradlew testDebug | |
# Hardware accelerated Android virtualization on Actions Linux larger hosted runners | |
- 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 | |
# Significantly reduce emulator startup time by setting up AVD snapshot caching | |
- 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.30.1 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
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 Android tests | |
uses: ReactiveCircus/android-emulator-runner@v2.30.1 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
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 payment-engine:connectedCheck |