forked from mozilla-mobile/focus-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
133 lines (132 loc) · 4.61 KB
/
.taskcluster.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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
version: 0
allowPullRequests: public
tasks:
###############################################################################
# Task: Pull requests
#
# Triggered whenever a pull request is opened or updated.
#
# - Build the app (all flavors)
# - Run unit tests
# - Run code quality tools (findbugs, lint, checkstyle etc.)
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
extra:
github:
events:
- pull_request.opened
- pull_request.edited
- pull_request.synchronize
- pull_request.reopened
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
image: 'mozillamobile/focus-android'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch {{ event.head.repo.url }} {{ event.head.repo.branch }}
&& git config advice.detachedHead false
&& git checkout {{event.head.sha}}
&& echo "--" > .adjust_token
&& ./gradlew clean assemble test lint pmd checkstyle findbugs
artifacts:
'public':
type: 'directory'
path: '/opt/focus-android/app/build/reports'
expires: "{{ '1 week' | $fromNow }}"
metadata:
name: Focus for Android - Build - Pull Request
description: Building Focus for Android (via Gradle) - triggered by a pull request.
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'
###############################################################################
# Task: Master builds
#
# Triggered whenever something is pushed/merged to the master branch.
#
# - Build the app (all flavors)
# - Run unit tests
# - Run code quality tools (findbugs, lint, checkstyle etc.)
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
extra:
github:
events:
- push
branches:
- master
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
image: 'mozillamobile/focus-android'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch origin
&& git config advice.detachedHead false
&& git checkout {{event.head.sha}}
&& echo "--" > .adjust_token
&& ./gradlew clean assemble test lint pmd checkstyle findbugs
artifacts:
'public':
type: 'directory'
path: '/opt/focus-android/app/build/reports'
expires: "{{ '1 week' | $fromNow }}"
metadata:
name: Focus for Android - Build - Master
description: Building Focus for Android (via Gradle) - Master
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'
###############################################################################
# Task: Release builds
#
# Triggered when a new tag or release is published (in any branch)
#
# - Build (unsigned) release versions of the app with release translations and
# adjust token.
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
extra:
github:
events:
- release
scopes:
- "secrets:get:project/focus/tokens"
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
image: 'mozillamobile/focus-android'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch origin --tags
&& git config advice.detachedHead false
&& git checkout {{ event.version }}
&& python tools/taskcluster/get-adjust-token.py
&& python tools/l10n/filter-release-translations.py
&& ./gradlew clean test assembleRelease
artifacts:
'public':
type: 'directory'
path: '/opt/focus-android/app/build/outputs/apk'
expires: "{{ '1 week' | $fromNow }}"
features:
taskclusterProxy: true
metadata:
name: Focus for Android - Release build ({{ event.version }})
description: Building release versions of Firefox Focus/Klar
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'