-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (57 loc) · 2.08 KB
/
ui_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
name: Flutter UI Tests (Firebase Test Lab)
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
integration_test:
runs-on: ubuntu-latest
steps:
# 1) Check out repo
- uses: actions/checkout@v3
# 2) Create google-services.json if you have it in a secret
- name: Create google-services.json
run: |
cat <<EOF > android/app/google-services.json
${{ secrets.GOOGLE_SERVICES_JSON }}
EOF
# 3) Install Flutter
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.5'
channel: 'stable'
# 4) Install Dependencies
- name: Install dependencies
run: flutter pub get
# 5) Install Patrol CLI
- name: Install Patrol CLI
run: flutter pub global activate patrol_cli
# 6) Authenticate Cloud SDK
- name: 'Authenticate Cloud SDK'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCLOUD_SERVICE_ACCOUNT_KEY }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
# 7) Build app & test APK
- name: Build app & test APK
run: |
patrol build android \
--target integration_test/patrol_test.dart \
--dart-define=APP_LOGIN_USER=${{ secrets.APP_LOGIN_USER }} \
--dart-define=APP_LOGIN_PASSWORD=${{ secrets.APP_LOGIN_PASSWORD }} \
--dart-define=APP_LOGIN_NUMBER=${{ secrets.APP_LOGIN_NUMBER }} \
--verbose
# 8) Run tests on Firebase Test Lab
- name: Run Tests on Firebase Test Lab
run: |
gcloud firebase test android run \
--type instrumentation \
--use-orchestrator \
--app build/app/outputs/apk/debug/app-debug.apk \
--test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--timeout 1m \
--device model=MediumPhone.arm,version=34,locale=en,orientation=portrait \
--record-video \
--environment-variables clearPackageData=true