Created
April 1, 2021 03:38
-
-
Save akexorcist/41941cbbdf4f0c1440371166b9be6ca0 to your computer and use it in GitHub Desktop.
Android CI + FIrebase Test Labs
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: Android CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
name: Unit Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Run Unit test | |
run: ./gradlew test | |
apk: | |
name: Generate APK | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Assemble App APK | |
run: ./gradlew assembleDebug | |
- name: Upload App APK | |
uses: actions/upload-artifact@v1 | |
with: | |
name: app-debug | |
path: app/build/outputs/apk/debug/app-debug.apk | |
- name: Assemble Android Instrumented Unit Test | |
run: ./gradlew assembleDebugAndroidTest | |
- name: Upload Android Test APK | |
uses: actions/upload-artifact@v1 | |
with: | |
name: app-debug-androidTest | |
path: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk | |
firebase: | |
name: Run UI tests with Firebase Test Lab | |
needs: apk | |
runs-on: ubuntu-18.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Download app APK | |
uses: actions/download-artifact@v1 | |
with: | |
name: app-debug | |
- name: Download Android test APK | |
uses: actions/download-artifact@v1 | |
with: | |
name: app-debug-androidTest | |
- name: Login to Google Cloud | |
uses: google-github-actions/setup-gcloud@master | |
with: | |
version: '270.0.0' | |
service_account_key: ${{ secrets.FIREBASE_SERVICES_KEY }} | |
- 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 app-debug/app-debug.apk | |
--test app-debug-androidTest/app-debug-androidTest.apk | |
--device model=flame,version=30,locale=en,orientation=portrait | |
--device model=x1q,version=29,locale=en,orientation=portrait | |
--device model=crownlte,version=28,locale=en,orientation=portrait | |
--device model=HWCOR,version=27,locale=en,orientation=portrait | |
--device model=SOV33,version=26,locale=en,orientation=portrait | |
--device model=mata,version=25,locale=en,orientation=portrait | |
--device model=HWMHA,version=24,locale=en,orientation=portrait | |
--device model=mlv1,version=23,locale=en,orientation=portrait | |
--device model=Nexus4,version=22,locale=en,orientation=portrait | |
--device model=flo,version=21,locale=en,orientation=portrait | |
--device model=victara,version=19,locale=en,orientation=portrait" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hidden gem 💯