Feat/di xendit #15
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: SDK Test | |
on: | |
pull_request: | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Gradle cache | |
uses: gradle/gradle-build-action@v2 | |
- 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 JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Touch local properties | |
run: touch local.properties | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-30 | |
- 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: 30 | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
ram-size: 4096M | |
script: echo "Generated AVD snapshot for caching." | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Print environment info | |
run: | | |
java -version | |
./gradlew --version | |
echo "Free space:" | |
df -h | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Run Instrumentation Test | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 30 | |
arch: x86_64 | |
force-avd-creation: false | |
disable-animations: true | |
ram-size: 4096M | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
script: ./gradlew :xendit-android:connectedCheck --stacktrace | |
# notify-slack: | |
# needs: unit-test | |
# runs-on: ubuntu-latest | |
# if: always() | |
# steps: | |
# - name: Notify Slack | |
# uses: ravsamhq/notify-slack-action@v1 | |
# with: | |
# status: ${{ needs.unit-test.result }} | |
# footer: 'Linked Repo <{repo_url}|{repo}> {branch}' | |
# notify_when: 'failure' | |
# env: | |
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |