Update CI configurations #5
This file contains hidden or 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 Instrumentation Tests" | |
on: [ push, pull_request ] | |
jobs: | |
instrumentation_tests: | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: set up Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Start emulator | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 30 | |
target: google_apis | |
arch: x86_64 | |
profile: Nexus 6 | |
script: | | |
adb shell pm grant com.vrem.wifianalyzer android.permission.ACCESS_COARSE_LOCATION | |
adb shell pm grant com.vrem.wifianalyzer android.permission.ACCESS_FINE_LOCATION | |
adb shell pm grant com.vrem.wifianalyzer android.permission.ACCESS_WIFI_STATE | |
adb shell pm grant com.vrem.wifianalyzer android.permission.CHANGE_WIFI_STATE | |
adb shell pm grant com.vrem.wifianalyzer android.permission.NEARBY_WIFI_DEVICES | |
- name: build app apk | |
run: bash ./gradlew assembleDebug | |
- name: build android test apk | |
run: bash ./gradlew assembleAndroidTest | |
- name: run tests | |
uses: emulator-wtf/run-tests@v0 | |
with: | |
api-token: ${{ secrets.EW_API_TOKEN }} | |
app: app/build/outputs/apk/debug/app-debug.apk | |
test: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk | |
outputs-dir: build/test-results | |
- name: publish test results | |
uses: mikepenz/action-junit-report@v5 | |
if: always() | |
with: | |
report_paths: 'build/test-results/**/*.xml' |