forked from gooddata/gooddata-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
315 lines (275 loc) · 8.11 KB
/
.travis.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
language: ruby
cache: bundler
stages:
- name: before-merge
if: type IN (push, pull_request)
- name: after-merge
if: type IN (api, cron)
- name: platform-cleanup
if: type IN (cron)
- name: gem-release
if: branch = master AND type = push
- name: gem-smoke-test
if: branch = master AND type = push
git:
depth: false # this is needed for pronto
jobs:
allow_failures:
- rvm: jruby-9.1.14
include:
# BEFORE MERGE
- name: pronto code review
stage: before-merge
script: |
git remote add upstream https://github.com/gooddata/gooddata-ruby.git
git fetch upstream develop
failed=0
PRONTO_FLAY_MASS_THRESHOLD=50 bundle exec pronto run -c upstream/develop --exit-code lib || failed=1
PRONTO_FLAY_MASS_THRESHOLD=100 bundle exec pronto run -c upstream/develop --exit-code spec || failed=1
if [ "$failed" -ne 0 ] ; then
exit 1
fi
# UNIT TESTS ON LINUX IN ALL SUPPORTED RUBY VERSIONS
- name: unit tests 2.3
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.3
- name: unit tests 2.4
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.4
- name: unit tests 2.5
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.5
- name: unit tests 2.6
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.6
- name: unit tests jruby-9.1.14
stage: before-merge
script: bundle exec rake test:unit
rvm: jruby-9.1.14
jdk: openjdk8
- name: sdk integration (vcr) tests - base
stage: before-merge
script: bundle exec rake test:sdk
env: VCR_RECORD_MODE=none
rvm: 2.3
- name: sdk integration (vcr) tests - project
stage: before-merge
script: bundle exec rake test:project
env: VCR_RECORD_MODE=none
rvm: 2.3
- name: lcm integration (vcr) tests - e2e
stage: before-merge
script: bundle exec rspec spec/lcm/integration/lcm_end_to_end_spec.rb
env:
- VCR_RECORD_MODE=none
rvm: 2.3
# AFTER MERGE
# staging 1
- &lcm-integration-tests
name: staging1 - lcm integration tests
stage: after-merge
script: |
bundle exec rake -f lcm.rake docker:build
bundle exec rake -f lcm.rake docker:bundle
bundle exec rake -f lcm.rake test:docker:integration
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
- &lcm-slow-tests
name: staging1 - lcm slow tests
stage: after-merge
script:
- sudo keytool -importcert -alias gooddata-2008 -file "./data/2008.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-int -file "./data/new_ca.cer" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-prod -file "data/new_prodgdc_ca.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- bundle exec rake -f lcm.rake test:slow
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
- &userprov-tests
name: staging1 - user provisioning tests
stage: after-merge
script: |
bundle exec rake -f lcm.rake docker:build
bundle exec rake -f lcm.rake docker:bundle
bundle exec rake -f lcm.rake test:docker:userprov
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
- &bricks-smoke-tests
name: staging1 - bricks smoke tests
stage: after-merge
script:
- sudo keytool -importcert -alias gooddata-2008 -file "./data/2008.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-int -file "./data/new_ca.cer" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-prod -file "data/new_prodgdc_ca.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- bundle exec rake -f lcm.rake test:smoke
env:
- GD_ENV=staging
- VCR_ON=false
rvm: jruby-9.1.14
jdk: openjdk8
- &sdk-integration-tests
name: staging1 - sdk integration tests - base
stage: after-merge
script: bundle exec rake test:sdk
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
- &sdk-integration-tests-project
name: staging1 - sdk integration tests - project
stage: after-merge
script: bundle exec rake test:project
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
# staging 2
- <<: *lcm-integration-tests
name: staging2 - lcm integration tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *lcm-slow-tests
name: staging2 - lcm slow tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *userprov-tests
name: staging2 - lcm user provisioning tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *bricks-smoke-tests
name: staging2 - bricks smoke tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *sdk-integration-tests
name: staging2 - sdk integration tests - base
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *sdk-integration-tests-project
name: staging2 - sdk integration tests - project
env:
- GD_ENV=testing
- VCR_ON=false
# staging 3
- <<: *lcm-integration-tests
name: staging3 - lcm integration tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *lcm-slow-tests
name: staging3 - lcm slow tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *userprov-tests
name: staging3 - lcm user provisioning tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *bricks-smoke-tests
name: staging3 - bricks smoke tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *sdk-integration-tests
name: staging3 - sdk integration tests - base
env:
- GD_ENV=development
- VCR_ON=false
- <<: *sdk-integration-tests-project
name: staging3 - sdk integration tests - project
env:
- GD_ENV=development
- VCR_ON=false
# cleanups
- &cleanup
stage: after-merge
name: staging1 - test environment clean-up
script: bundle exec ruby bin/test_projects_cleanup.rb -f
env: GD_ENV=staging
- <<: *cleanup
name: staging2 - test environment clean-up
env: GD_ENV=testing
- <<: *cleanup
name: staging3 - test environment clean-up
env: GD_ENV=development
# AFTER MERGE UNIT TESTS ON ALTERNATIVE PLATFORM
- name: unit tests 2.3
stage: after-merge
script: bundle exec rake test:unit
os: osx
osx_image: xcode7.3
rvm: 2.3
- name: unit tests 2.4
stage: after-merge
script: bundle exec rake test:unit
os: osx
osx_image: xcode9.4
rvm: 2.4.3
- name: unit tests 2.5
stage: after-merge
script: bundle exec rake test:unit
os: osx
osx_image: xcode9
rvm: 2.5
- name: unit tests 2.6
stage: after-merge
script: bundle exec rake test:unit
os: osx
osx_image: xcode9
rvm: 2.6
- name: unit tests jruby-9.1.14
stage: after-merge
script: bundle exec rake test:unit
os: osx
rvm: jruby-9.1.14
- stage: gem-release
name: deploy MRI gem
rvm: 2.3
deploy:
provider: rubygems
gem: gooddata
api_key: $RUBYGEMS_API_KEY
- stage: gem-release
name: deploy JRuby gem
rvm: jruby-9.1.14
jdk: openjdk8
script: |
echo -e "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
bundle exec rake gem:release
- &gem-smoke-test
stage: gem-smoke-test
name: smoke test MRI gem
rvm: 2.3
script: |
gem install gooddata
ruby -e "require 'gooddata';GoodData.version"
- <<: *gem-smoke-test
name: smoke test JRuby gem
rvm: jruby-9.1.14
jdk: openjdk8
notifications:
email:
recipients:
secure: AMTssALc5Qt4ApAoI7gCmqP3d7AL0dGyZ+DsxYYlas2T0tjXdOH97XlY2jRzFSxZU1P3JKJkjHLmxu0m908Q28SQVcdBlK29Ofyl2pwGnniExY4wdQJLmqNW9eKa2dmSMUsntR6DryNThKVn9mqUACdXgpT8X2CnQl/DWMGpo80=
on_success: always
on_failure: always