-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcloudbuild.android.yaml
More file actions
87 lines (74 loc) · 2.64 KB
/
Copy pathcloudbuild.android.yaml
File metadata and controls
87 lines (74 loc) · 2.64 KB
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
options:
logging: CLOUD_LOGGING_ONLY
substitutions:
_ANDROID_FTL_DEVICE_MODEL: ''
_ANDROID_FTL_DEVICE_VERSION: ''
_ANDROID_FTL_RESULTS_BUCKET: ''
_ANDROID_FTL_RESULTS_DIR: ''
timeout: 3600s
steps:
- id: Validate Firebase Test Lab configuration
name: gcr.io/cloud-builders/gcloud
entrypoint: bash
args:
- -ceu
- |
project_id="${PROJECT_ID}"
device_model="${_ANDROID_FTL_DEVICE_MODEL}"
device_version="${_ANDROID_FTL_DEVICE_VERSION}"
results_bucket="${_ANDROID_FTL_RESULTS_BUCKET}"
results_dir="${_ANDROID_FTL_RESULTS_DIR}"
missing_values=()
if [[ -z "${project_id}" ]]; then
missing_values+=("PROJECT_ID")
fi
if [[ -z "${device_model}" ]]; then
missing_values+=("_ANDROID_FTL_DEVICE_MODEL")
fi
if [[ -z "${device_version}" ]]; then
missing_values+=("_ANDROID_FTL_DEVICE_VERSION")
fi
if [[ -z "${results_bucket}" ]]; then
missing_values+=("_ANDROID_FTL_RESULTS_BUCKET")
fi
if [[ -z "${results_dir}" ]]; then
missing_values+=("_ANDROID_FTL_RESULTS_DIR")
fi
if [[ "${#missing_values[@]}" -gt 0 ]]; then
printf 'Missing required Cloud Build substitutions for Firebase Test Lab: %s\n' "${missing_values[*]}" >&2
exit 1
fi
- id: Build Android CI image
name: gcr.io/cloud-builders/docker
args:
- build
- --tag
- flashcards-android-ci:latest
- --file
- apps/android/ci/Dockerfile
- .
- id: Build debug app, test APK, and lint
name: flashcards-android-ci:latest
entrypoint: bash
args:
- -ceu
- /workspace/scripts/android/run-android-ci.sh
- id: Run Firebase Test Lab instrumentation tests
name: flashcards-android-ci:latest
entrypoint: bash
args:
- -ceu
- |
test_lab_args=(
--project-id "${PROJECT_ID}"
--device-model "${_ANDROID_FTL_DEVICE_MODEL}"
--device-version "${_ANDROID_FTL_DEVICE_VERSION}"
--app-path "/workspace/apps/android/app/build/outputs/apk/debug/app-debug.apk"
--test-path "/workspace/apps/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk"
--timeout "30m"
--max-matrix-duration "35m"
--test-targets "package com.flashcardsopensourceapp.app notAnnotation com.flashcardsopensourceapp.app.ManualOnlyAndroidTest"
--results-bucket "${_ANDROID_FTL_RESULTS_BUCKET}"
--results-dir "${_ANDROID_FTL_RESULTS_DIR}"
)
/workspace/scripts/android/run-android-firebase-test-lab.sh "${test_lab_args[@]}"