forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
211 lines (197 loc) · 5.02 KB
/
circle.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
version: 2
workflows:
version: 2
default:
jobs:
- prepare:
filters:
tags:
only: /.*/
- lint:
requires:
- prepare
filters:
tags:
only: /.*/
- build:
requires:
- prepare
filters:
tags:
only: /.*/
- test-flow:
requires:
- prepare
filters:
tags:
only: /.*/
- test-unit:
requires:
- prepare
filters:
tags:
only: /.*/
- test-render:
requires:
- prepare
filters:
tags:
only: /.*/
- test-query:
requires:
- prepare
filters:
tags:
only: /.*/
- test-expressions:
requires:
- prepare
filters:
tags:
only: /.*/
- deploy-benchmarks:
requires:
- lint
- build
- test-flow
- test-unit
- test-render
- test-query
- test-expressions
filters:
tags:
only: /v[0-9]+.[0-9]+.[0-9]+(-.+)?/
branches:
only:
- master
- /release-.*/
- deploy-release:
requires:
- lint
- build
- test-flow
- test-unit
- test-render
- test-query
- test-expressions
filters:
tags:
only: /v[0-9]+.[0-9]+.[0-9]+(-.+)?/
branches:
ignore: /.*/
defaults: &defaults
docker:
- image: mbgl/ci:r4-linux-gl-js
working_directory: ~/mapbox-gl-js
jobs:
prepare:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-yarn-{{ checksum "yarn.lock" }}
- v1-yarn
- run: yarn
- save_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}
paths:
- '~/.yarn'
- 'node_modules'
- persist_to_workspace:
root: .
paths:
- .
lint:
<<: *defaults
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- v1-lint-{{ .Branch }}
- v1-lint
- run: yarn run lint
- run: yarn run lint-docs
- run: yarn run lint-css
- save_cache:
key: v1-lint-{{ .Branch }}-{{ .Revision }}
paths:
- '.eslintcache'
build:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: yarn run build-min
- run: yarn run build-dev
- run: yarn run build-css
- run: yarn run build-style-spec
- run: yarn run test-build
- persist_to_workspace:
root: .
paths:
- dist
test-flow:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: yarn run test-flow
test-unit:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: xvfb-run --server-args="-screen 0 1024x768x24" npm run test-unit
test-render:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: xvfb-run --server-args="-screen 0 1024x768x24" npm run test-render
- store_artifacts:
path: "test/integration/render-tests/index.html"
test-query:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: xvfb-run --server-args="-screen 0 1024x768x24" npm run test-query
- store_artifacts:
path: "test/integration/query-tests/index.html"
test-expressions:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: yarn run test-expressions
deploy-benchmarks:
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
name: Build
command: BENCHMARK_VERSION="${CIRCLE_TAG:-$CIRCLE_BRANCH} $(git rev-parse --short=7 HEAD)" yarn run build-benchmarks
- run:
name: Upload
command: aws s3 cp --acl public-read --content-type application/javascript bench/benchmarks_generated.js s3://mapbox-gl-js/${CIRCLE_TAG:-$CIRCLE_BRANCH}/benchmarks.js
deploy-release:
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
name: Deploy release
command: |
function upload {
aws s3 cp --acl public-read --content-type $2 dist/$1 s3://mapbox-gl-js/$CIRCLE_TAG/$1
AWS_ACCESS_KEY_ID=$AWSCN_ACCESS_KEY_ID \
AWS_SECRET_ACCESS_KEY=$AWSCN_SECRET_ACCESS_KEY \
aws s3 cp --region cn-north-1 --acl public-read --content-type $2 dist/$1 s3://mapbox-gl-js-cn-north-1/$CIRCLE_TAG/$1
}
upload mapbox-gl.js application/javascript
upload mapbox-gl.js.map application/octet-stream
upload mapbox-gl-dev.js application/javascript
upload mapbox-gl.css text/css