Skip to content

Update commit_validation.yml #81

Update commit_validation.yml

Update commit_validation.yml #81

name: Runs UI Tests on commits to master
on:
push:
branches:
- main
jobs:
run_ui_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Ensure valid gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Auth for gcloud
id: 'auth'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up gcloud sdk
uses: google-github-actions/setup-gcloud@v2
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Assemble test apk
run: ./gradlew assembleDebugAndroidTest
- name: Rename test apk
run: mv ./libtestingexample/build/outputs/apk/androidTest/debug/libtestingexample-debug-androidTest.apk ./test.apk
- name: Assemble app apk
run: ./gradlew assembleDebugAndroidTest -DtestApplicationId=me.jdvp.librarytestexample
- name: Rename app apk
run: mv ./libtestingexample/build/outputs/apk/androidTest/debug/libtestingexample-debug-androidTest.apk ./app.apk
- name: Set gcloud project id
run: gcloud config set project ${{ env.GCLOUD_PROJECT }}
- name: Run test lab tests
run: |-
gcloud firebase test android run \
--type instrumentation \
--app ./app.apk \
--test ./test.apk \
--results-history-name='libtestingexample results' \
--device model=MediumPhone.arm,version=29,locale=en,orientation=portrait