CI initial setup #3
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: Pull requests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test_and_build: | |
name: "Unit tests and build APK" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Check build-logic | |
run: ./gradlew check -p build-logic | |
- name: Unit tests | |
run: ./gradlew test | |
- name: Build APK | |
run: ./gradlew app:assembleDebug | |
android_test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 50 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Run Android Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 26 | |
arch: x86_64 | |
disable-animations: true | |
script: ./gradlew connectedDebugAndroidTest | |
- name: Upload test reports | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-reports | |
path: '**/build/reports/androidTests' |