Update the aab file path for the play store upload #95
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: Network Survey CI | |
on: | |
pull_request: | |
branches: | |
- 'develop' | |
push: | |
branches: | |
- 'develop' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Save google-services.json | |
env: | |
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} | |
run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json | |
- name: Build Regular APK | |
run: ./gradlew assembleRegularDebug --stacktrace | |
- name: Get APK name | |
run: echo "base_name=`./gradlew :networksurvey:properties -q | grep 'archivesBaseName:' | awk '{print $2}'`" >> $GITHUB_ENV | |
- name: Upload Regular APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Network Survey Regular Debug APK | |
path: networksurvey/build/outputs/apk/regular/debug/${{ env.base_name }}-regular-debug.apk | |
- name: Build CDR APK | |
run: ./gradlew assembleCdrDebug --stacktrace | |
- name: Upload CDR APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Network Survey CDR Debug APK | |
path: networksurvey/build/outputs/apk/cdr/debug/${{ env.base_name }}-cdr-debug.apk | |
test: | |
name: Run Tests | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
api-level: [ 26, 34 ] | |
target: [ default, google_apis ] | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Save google-services.json | |
env: | |
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} | |
run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json | |
- name: Unit Tests | |
run: ./gradlew test --stacktrace | |
# Need to work through a permissions error to get these working | |
# - name: Instrumentation Tests | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# with: | |
# api-level: ${{ matrix.api-level }} | |
# target: ${{ matrix.target }} | |
# arch: x86_64 | |
# profile: Nexus 6 | |
# script: ./gradlew test check connectedCheck -x lint --stacktrace | |
# Only upload the reports on failure | |
- name: Upload Reports | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Test-Reports | |
path: networksurvey/build/reports | |
if: failure() |