-
Notifications
You must be signed in to change notification settings - Fork 35
/
cloudbuild.yaml
76 lines (68 loc) · 1.85 KB
/
cloudbuild.yaml
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
steps:
# Pull most recent Docker image.
- id: 'pull-image'
name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/${_IMAGE_NAME}:head']
waitFor: ['-']
# Build the new Docker image (caching from the pre-built one)
- id: 'build-image'
name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'--cache-from=gcr.io/$PROJECT_ID/${_IMAGE_NAME}:head',
'--tag=gcr.io/$PROJECT_ID/${_IMAGE_NAME}:head',
'--tag=arcs-base',
'.',
]
waitFor: ['pull-image']
# Push updated Docker image to Container Registry.
- id: 'push-image'
name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/${_IMAGE_NAME}:head']
waitFor: ['build-image']
# Run non-integration tests.
- id: 'presubmit'
name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'--network=cloudbuild',
'--rm', 'arcs-base',
'tools/cloud-presubmit',
'--bazelrc=tools/gcb.bazelrc',
]
waitFor: ['build-image']
# Build Android integration test apks.
- id: 'build-test-apks'
name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'--network=cloudbuild',
'--volume', '/workspace:/workspace',
'--rm', 'arcs-base',
'tools/build-test-apks',
'--bazelrc=tools/gcb.bazelrc',
]
waitFor: ['build-image']
# Run Android integration test in Firebase Test Lab.
- id: 'android-firebase-test-lab'
name: 'gcr.io/cloud-builders/gcloud'
args: [
'firebase',
'test',
'android',
'run',
'--type', 'instrumentation',
'--app', '/workspace/testapp.apk',
'--test', '/workspace/e2e.apk',
'--device', 'model=Pixel2,version=29,locale=en,orientation=portrait',
'--use-orchestrator',
]
waitFor: ['build-test-apks']
images:
- 'gcr.io/$PROJECT_ID/${_IMAGE_NAME}'
timeout: 3600s # 60 mins, just in case.
logsBucket: 'gs://arcs-github-gcb-logs'
options:
machineType: 'N1_HIGHCPU_32'
substitutions:
_IMAGE_NAME: arcs