-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.89 KB
/
instrumented-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Android Instrumented Tests
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
instrumentation-tests:
name: Run Android Instrumented Tests
runs-on: macos-latest
strategy:
matrix:
organization: [ ooni, dw ]
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build APKs
run: ./gradlew copyBrandingToCommonResources assembleFullDebug assembleFullDebugAndroidTest -Porganization=${{ matrix.organization }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 495.0.0'
- name: GCloud authentication
env:
INPUT_SERVICE_CREDENTIALS_FILE_CONTENT: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
GOOGLE_APPLICATION_CREDENTIALS: service_credentials_content.json
run: |
cat <<< "${INPUT_SERVICE_CREDENTIALS_FILE_CONTENT}" > service_credentials_content.json
gcloud auth activate-service-account --key-file=service_credentials_content.json
- name: Firebase Test Lab
run: >-
LABEL=$(git show -s --format='%H')
gcloud firebase test android run
--type instrumentation
--app composeApp/build/outputs/apk/full/debug/composeApp-full-debug.apk
--test composeApp/build/outputs/apk/androidTest/full/debug/composeApp-full-debug-androidTest.apk
--device model=MediumPhone.arm,version=29,locale=en,orientation=portrait
--timeout 180s
--num-flaky-test-attempts=2
--client-details matrixLabel="$LABEL"
--use-orchestrator
--environment-variables clearPackageData=true
--project ooniprobe-android
--test-targets "package org.ooni.probe.uitesting"