Skip to content

Commit

Permalink
Update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rafsanjani committed Nov 21, 2024
1 parent 80fd450 commit a2d269a
Showing 1 changed file with 45 additions and 27 deletions.
72 changes: 45 additions & 27 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,24 @@ jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Make gradle wrapper executable
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build

Automation:
needs: Build
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Make gradle wrapper executable
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build

automation:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -40,21 +39,40 @@ jobs:
java-version: '17'
distribution: 'zulu'
cache: gradle

- name: Setup Gradle
uses: gradle/actions/setup-gradle@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: Run UI Tests
- 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: 33
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: 29
ndk: 21.0.6113669
cmake: 3.10.2.4988404
api-level: 33
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 app:connectedCheck

0 comments on commit a2d269a

Please sign in to comment.