Create room db, test DAOs and add android test workflow script #5
Workflow file for this run
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: Run test | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: gradle | |
- name: Grant execute permissions for gradlew | |
run: chmod +x gradlew | |
- name: Run unit tests | |
run: ./gradlew clean testDebug | |
android_test_job: | |
name: Android Test | |
runs-on: macos-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Grant execute permissions for gradlew | |
run: chmod +x gradlew | |
- name: Restore Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Run Android Instrumentation Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
script: ./gradlew connectedDebugAndroidTest | |
- name: Upload Android Test Reports | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: android-test-reports | |
path: '**/build/reports/androidTests/' |