forked from json-e/json-e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
170 lines (168 loc) · 5.58 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
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
166
167
168
169
170
version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$let:
owner: [email protected]
# This only supports pushes and pull requests for now.
# If we start responding to another action type, make this
# a $match.
repo:
$if: 'tasks_for == "github-push"'
then:
git_url: ${event.repository.url}
url: ${event.repository.url}
ref: ${event.after}
else:
git_url: ${event.pull_request.head.repo.git_url}
url: ${event.pull_request.head.repo.url}
ref: ${event.pull_request.head.sha}
in:
$let:
environments:
- image: node:6
name: node:6 tests
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
yarn &&
yarn test
- image: node:10
name: node:10 tests
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
yarn &&
yarn test
- image: 'node:10'
name: node import test
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
yarn &&
bash package-test.sh
- image: 'python:2.7'
name: python:2.7 tests
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
pip install -e . &&
python setup.py test
- image: 'python:3.6'
name: python:3.6 tests
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
pip install -e . &&
python setup.py test
- image: 'golangci/golangci-lint'
name: golang lint and tests
command:
- /bin/bash
- '-c'
- >-
mkdir -p /go/src/github.com/taskcluster/json-e &&
cd /go/src/github.com/taskcluster/json-e &&
git clone ${repo.git_url} . &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
go get -v -d -t ./... &&
go test -v -race ./... &&
golangci-lint run
in:
$let:
tests:
$map: {$eval: environments}
each(env):
taskId: {$eval: as_slugid(env.name)}
provisionerId: aws-provisioner-v1
workerType: github-worker
created: {$fromNow: ''}
deadline: {$fromNow: '60 minutes'}
payload:
maxRunTime: 3600
image: ${env.image}
command: {$eval: 'env.command'}
metadata:
name: ${env.name}
description: ${env.name}
owner: ${owner}
source: ${repo.url}
in:
$flattenDeep:
- $if: 'tasks_for == "github-push"'
then:
- {$eval: tests}
- $if: 'event["ref"] == "refs/heads/master"'
then:
taskId: {$eval: as_slugid("demo_build")}
provisionerId: aws-provisioner-v1
workerType: github-worker
created: {$fromNow: ''}
deadline: {$fromNow: '60 minutes'}
scopes:
- secrets:get:repo:github.com/taskcluster/json-e
routes:
payload:
env:
GITHUB_BRANCH: ${event["ref"]}
GITHUB_BASE_REPO_URL: ${repo.git_url}
features:
taskclusterProxy: true
maxRunTime: 3600
image: node:8
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
yarn &&
yarn build-demo &&
./deploy.sh
metadata:
name: demo site build and deploy
description: build and publish a new demo site
owner: ${owner}
source: ${repo.url}
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"]'
then:
# We can skip this if pushed to our own repo since push event will get it
$if: 'event.pull_request.base.repo.id != event.pull_request.head.repo.id'
then: {$eval: tests}