-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (73 loc) · 2.35 KB
/
run_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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Run tests
on:
pull_request:
branches: [ "master" ]
jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean testDebug
apk:
name: Generate APK
needs: unit_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Assemble app debug APK
run: ./gradlew assembleDebug
- name: Upload app APK
uses: actions/upload-artifact@v3
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
- name: Assemble app instrumentation tests
run: ./gradlew assembleDebugAndroidTest
- name: Upload app test APK
uses: actions/upload-artifact@v3
with:
name: app-debug-androidTest
path: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
ui_test:
name: Run UI tests with Firebase Test Lab
needs: apk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download app APK
uses: actions/download-artifact@v3
with:
name: app-debug
path: app-debug
- name: Download app test APK
uses: actions/download-artifact@v3
with:
name: app-debug-androidTest
path: app-debug-androidTest
- id: Auth
uses: google-github-actions/auth@v1
with:
project_id: ${{ secrets.FIREBASE_PROJECT_ID }}
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Use gcloud CLI
run: gcloud info
- 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=blueline,version=28