-
Notifications
You must be signed in to change notification settings - Fork 494
100 lines (82 loc) · 2.83 KB
/
build_test.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
94
95
96
97
98
99
100
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events for the `master` and `kotlin` branches
on:
push:
branches:
- master
- kotlin
pull_request:
branches:
- master
- kotlin
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build will compile APK, test APK and run tests, lint, etc.
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 45
env:
TERM: dumb
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build and check
run: ./gradlew assembleDebug assembleDebugAndroidTest app:lintDebug testDebug
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v1
with:
name: build-reports
path: app/build/reports
- name: Copy test results
if: always()
run: |
mkdir -p junit
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} junit/ \;
- name: Upload test results
if: always()
uses: actions/upload-artifact@v1
with:
name: junit-results
path: junit
- name: Upload app APK
uses: actions/upload-artifact@v1
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
- 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
# Upload APKs to FTL and run instrumented tests
firebase:
name: Run UI tests with Firebase Test Lab
needs: build
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Download app APK
uses: actions/[email protected]
with:
name: app-debug
- name: Download Android test APK
uses: actions/[email protected]
with:
name: app-debug-androidTest
- name: Login to Google Cloud
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '281.0.0'
service_account_key: ${{ secrets.FTL_KEY_BASE64 }}
- 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=Pixel2,version=28,locale=pl,orientation=portrait