Skip to content

feat: firebase test lab action #985

feat: firebase test lab action

feat: firebase test lab action #985

name: The Countly Android SDK Unit Test
env:
EMULATOR_REPO: us-docker.pkg.dev/android-emulator-268719/images/28-playstore-x64:30.1.2
JAVA_V: 11
JAVA_DIST: corretto
permissions:
checks: write
pull-requests: write
on:
push:
branches:
- master
- staging
pull_request:
branches:
- master
- staging
jobs:
setup:
runs-on: ubuntu-latest
name: Build and Test the SDK
steps:
- name: Checkout SDK code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_V }}
distribution: ${{ env.JAVA_DIST }}
- name: Setup Android SDK
uses: android-actions/setup-android@v2.0.10
- name: Set AAPT2 for android 35
run: echo "android.aapt2FromMavenOverride=/usr/local/lib/android/sdk/build-tools/35.0.0/aapt2" | tee -a ${{ github.workspace }}/gradle.properties
- name: Build the SDK
if: always()
run: ./gradlew sdk:build
- name: Build the Android Test Apk
run: ./gradlew sdk:assembleAndroidTest
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' #service account json
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
- name: Set current project
run: gcloud config set project ${{ secrets.FIREBASE_PROJECT_ID }}
- name: Run Instrumentation Tests in Firebase Test Lab
run: gcloud firebase test android run --type instrumentation --app sdk/build/outputs/apk/androidTest/debug/sdk-debug-androidTest.apk --test sdk/build/outputs/apk/androidTest/debug/sdk-debug-androidTest.apk --device model=MediumPhone.arm,version=26 --device model=MediumPhone.arm,version=27 --device model=MediumPhone.arm,version=28 --device model=MediumPhone.arm,version=29 --device model=MediumPhone.arm,version=30 --device model=MediumPhone.arm,version=31 --device model=MediumPhone.arm,version=32 --device model=MediumPhone.arm,version=33 --device model=MediumPhone.arm,version=34 --device model=MediumPhone.arm,version=35