Migrate CI from CircleCI to GitHub Actions #5
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 test | |
| - name: Run instrumented tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 35 | |
| arch: x86_64 | |
| target: google_apis | |
| profile: pixel_6 | |
| disable-animations: true | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| script: cd BluePlaquesLondon && ./gradlew :app:connectedAndroidTest | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| 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 |