Migrate CI from CircleCI to GitHub Actions #9
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [ develop, master, main ] | |
| pull_request: | |
| branches: [ develop, master, main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| env: | |
| GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| cache-read-only: false | |
| - name: Make gradlew executable | |
| run: chmod +x BluePlaquesLondon/gradlew | |
| - name: Build debug APK | |
| run: cd BluePlaquesLondon && ./gradlew assembleDebug | |
| - name: Run unit tests | |
| run: cd BluePlaquesLondon && ./gradlew testDebugUnitTest --no-daemon | |
| - name: Run instrumented tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 31 | |
| arch: x86_64 | |
| target: default | |
| profile: pixel_4a | |
| disable-animations: true | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| script: cd BluePlaquesLondon && ./gradlew connectedDebugAndroidTest --no-daemon --continue | |
| - name: Generate coverage report | |
| if: always() | |
| run: cd BluePlaquesLondon && ./gradlew jacocoTestReport --no-daemon --continue | |
| - name: Upload coverage to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./BluePlaquesLondon/app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: Upload test reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports | |
| path: | | |
| BluePlaquesLondon/app/build/reports/ | |
| BluePlaquesLondon/app/build/outputs/androidTest-results/ | |
| - name: Upload APK | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug | |
| path: BluePlaquesLondon/app/build/outputs/apk/debug/app-debug.apk |