-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbitrise.yml
165 lines (156 loc) · 5.58 KB
/
bitrise.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
workflows:
parallel-tests:
description: |
Runs tests.
Next steps:
- Check out [Getting started with Android apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-android-apps.html).
steps:
- activate-ssh-key@4: {}
- file-downloader@1:
title: Download Google Service Account JSON
inputs:
- source: "$BITRISEIO_SERVICE_ACCOUNT_URL"
- destination: "./keys/firebase-key.json"
- script@1:
inputs:
- content: "#!/usr/bin/env bash\nset -e\nset -o pipefail\nset -x\n\necho \"$SERVICE_ACCOUNT_KEY_JSON\"
> $HOME/.config/gcloud/application_default_credentials.json \n\ngcloud
auth activate-service-account --project=$GOOGLE_CLOUD_PROJECT --key-file=$SERVICE_ACCOUNT_KEY_JSON"
title: Configure Google Service Account
- git-clone@6: {}
- cache-pull@2: {}
- install-missing-android-tools@3:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
- android-build-for-ui-testing@0:
inputs:
- variant: debug
- module: app
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
set -o pipefail
# debug log
set -x
gcloud firebase test android run \
--type instrumentation \
--app $BITRISE_APK_PATH \
--test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device model=Pixel3,version=30,locale=en,orientation=portrait
- script@1:
title: Generate Flank config
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
cat << FLANKEOF > ./flank.yml
gcloud:
results-bucket: uitests-reports
results-dir: $BITRISE_BUILD_NUMBER
record-video: true
timeout: 30m
async: false
app: $BITRISE_APK_PATH
test: $BITRISE_TEST_APK_PATH
use-orchestrator: true
environment-variables:
coverage: true
coverageFilePath: "/sdcard/"
clearPackageData: true
directories-to-pull:
- "/sdcard/"
performance-metrics: false
test-targets:
- "annotation com.sample.samplecalculator.utils.RegressionTest"
device:
- model: "Pixel2"
version: "30"
flank:
max-test-shards: 6
num-test-runs: 1
shard-time: 30
smart-flank-gcs-path: "gs://uitests-reports/android_ta.xml"
test-targets-always-run:
- "package com.sample.samplecalculator.regression"
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
#set -o pipefail
set -x
wget --quiet https://github.com/TestArmada/flank/releases/download/v22.05.0/flank.jar -O /usr/local/bin/flank.jar
java -jar /usr/local/bin/flank.jar firebase test android run
title: Run Flank
- script@1:
inputs:
- content: |-
#!/bin/env bash
gcloud auth activate-service-account --project=$GOOGLE_CLOUD_PROJECT --key-file=$SERVICE_ACCOUNT_KEY_JSON
echo "$SERVICE_ACCOUNT_KEY_JSON" > $HOME/.config/gcloud/application_default_credentials.json
mkdir firebase-test-results
#gsutil cp "gs://uitests-reports/$BITRISE_BUILD_NUMBER/matrix_0/Pixel2-30-en-portrait/test_result_1.xml" "firebase-test-results/test_result.xml"
gsutil cp "gs://uitests-reports/$BITRISE_BUILD_NUMBER/JUnitReport.xml" "firebase-test-results/test_result.xml"
title: Collect Tests Results
- custom-test-results-export@0:
inputs:
- base_path: "./firebase-test-results/"
- search_pattern: "*"
- test_name: Firebase UI Tests Results
- cache-push@2: {}
- deploy-to-bitrise-io@2: {}
primary:
description: |
Runs tests.
Next steps:
- Check out [Getting started with Android apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-android-apps.html).
steps:
- activate-ssh-key@4: {}
- git-clone@6: {}
- cache-pull@2: {}
- install-missing-android-tools@3:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
inputs:
- variant: debug
- module: app
inputs:
- test_type: instrumentation
- inst_test_targets: package com.sample.samplecalculator.regression
- inst_use_orchestrator: 'true'
- num_flaky_test_attempts: '5'
- test_devices: Pixel3,30,en,portrait
title: Virtual Device Testing for Android
- cache-push@2: {}
- deploy-to-bitrise-io@2: {}
meta:
bitrise.io:
stack: linux-docker-android-20.04
machine_type_id: elite-xl
app:
envs:
- opts:
is_expand: false
PROJECT_LOCATION: "."
- opts:
is_expand: false
MODULE: app
- opts:
is_expand: false
VARIANT: debug
trigger_map:
- pull_request_source_branch: "*"
workflow: primary