forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
416 lines (372 loc) · 11.9 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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
version: ~> 1.0
dist: xenial
os: linux
language: java
cache:
directories:
- ~/.m2
addons:
apt:
packages:
- xsltproc
- xmlstarlet
branches:
only:
- master
install:
- ""
jobs:
fast_finish: true
include:
# testing age of pr
- env:
- DESC="test Commits Since Latest Master"
- CMD="./.ci/travis/travis.sh pr-age"
- SKIP_JOB_BY_FILES="false"
# testing of PR format
- env:
- DESC="test Issue ref in PR description"
- CMD="./.ci/travis/travis.sh pr-description"
- SKIP_JOB_BY_FILES="false"
# new questionably spelled words
- env:
- DESC="spell checker"
- CMD="./.ci/test-spelling-unknown-words.sh"
- SKIP_JOB_BY_FILES="false"
# unit tests (openjdk8)
- jdk: openjdk8
env:
- DESC="tests and deploy"
- CMD="mvn -e clean integration-test failsafe:verify -DargLine='-Xms1024m -Xmx2048m'"
- DEPLOY="true"
- USE_MAVEN_REPO="true"
# checkstyle (openjdk8)
- jdk: openjdk8
env:
- DESC="checkstyle and sevntu-checkstyle"
- CMD="./.ci/travis/travis.sh checkstyle-and-sevntu"
- SKIP_JOB_BY_FILES="false"
- USE_MAVEN_REPO="true"
# jacoco and codecov (openjdk8)
- jdk: openjdk8
env:
- DESC="jacoco and codecov"
- CMD="./.ci/travis/travis.sh jacoco"
- CMD_AFTER_SUCCESS="bash <(curl -s https://codecov.io/bash)"
- USE_MAVEN_REPO="true"
# spotbugs and pmd (openjdk8)
- jdk: openjdk8
env:
- DESC="spotbugs,pmd"
- CMD="export MAVEN_OPTS='-Xmx2000m' && mvn -e clean test-compile pmd:check spotbugs:check"
- USE_MAVEN_REPO="true"
# spotbugs and pmd (openjdk11)
- jdk: openjdk11
env:
- DESC="spotbugs,pmd"
- CMD="export MAVEN_OPTS='-Xmx2000m' && mvn -e clean test-compile pmd:check spotbugs:check"
- USE_MAVEN_REPO="true"
# spotbugs and pmd (openjdk14)
- jdk: openjdk14
env:
- DESC="spotbugs,pmd"
- CMD="export MAVEN_OPTS='-Xmx2000m' && mvn -e clean test-compile pmd:check spotbugs:check"
- USE_MAVEN_REPO="true"
# eclipse static analysis
- jdk: openjdk8
env:
- DESC="eclipse static analysis"
- CMD="mvn -e clean compile exec:exec -Peclipse-compiler"
- USE_MAVEN_REPO="true"
# Releasenotes generation - validation
- jdk: openjdk8
env:
- DESC="Releasenotes generation"
- CMD="./.ci/travis/travis.sh releasenotes-gen"
- SKIP_JOB_BY_FILES="false"
- USE_MAVEN_REPO="true"
# NonDex (openjdk8)
- jdk: openjdk8
env:
- DESC="NonDex"
- CMD="./.ci/travis/travis.sh nondex"
- USE_MAVEN_REPO="true"
# site
- jdk: openjdk8
env:
- DESC="site without validations"
- CMD="./.ci/travis/travis.sh site"
- USE_MAVEN_REPO="true"
# unit tests in German locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests de"
- CMD="./.ci/travis/travis.sh test-de"
- USE_MAVEN_REPO="true"
# unit tests in Spanish locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests es"
- CMD="./.ci/travis/travis.sh test-es"
- USE_MAVEN_REPO="true"
# unit tests in Finnish locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests fi"
- CMD="./.ci/travis/travis.sh test-fi"
- USE_MAVEN_REPO="true"
# unit tests in French locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests fr"
- CMD="./.ci/travis/travis.sh test-fr"
- USE_MAVEN_REPO="true"
# unit tests in Chinese locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests zh"
- CMD="./.ci/travis/travis.sh test-zh"
- USE_MAVEN_REPO="true"
# unit tests in Japanese locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests ja"
- CMD="./.ci/travis/travis.sh test-ja"
- USE_MAVEN_REPO="true"
# unit tests in Portuguese locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests pt"
- CMD="./.ci/travis/travis.sh test-pt"
- USE_MAVEN_REPO="true"
# unit tests in Turkish locale (openjdk8)
- jdk: openjdk8
env:
- DESC="tests tr"
- CMD="./.ci/travis/travis.sh test-tr"
- USE_MAVEN_REPO="true"
# assembly (openjdk8)
- jdk: openjdk8
env:
- DESC="assembly & run '-all' jar"
- CMD="./.ci/travis/travis.sh assembly-run-all-jar"
- USE_MAVEN_REPO="true"
# NoExceptiontest - Guava with google_checks (openjdk8)
- jdk: openjdk8
env:
- DESC="NoExceptionTest - Guava with google_checks"
- CMD="./.ci/travis/travis.sh no-exception-test-guava-with-google-checks"
- USE_MAVEN_REPO="true"
# NoExceptiontest - Guava with sun_checks (openjdk8)
- jdk: openjdk8
env:
- DESC="NoExceptionTest - Guava with sun_checks"
- CMD="./.ci/travis/travis.sh no-exception-test-guava-with-sun-checks"
- USE_MAVEN_REPO="true"
# release dry run (openjdk8)
- jdk: openjdk8
env:
- DESC="release dry run"
- CMD="./.ci/travis/travis.sh release-dry-run"
- USE_MAVEN_REPO="true"
# Check the chmod on files.
- env:
- DESC="check permissions on all files"
- CMD="./.ci/travis/travis.sh check-chmod"
- SKIP_JOB_BY_FILES="false"
# Ensure that all Sevntu check are kused
- jdk: openjdk8
env:
- DESC="All sevntu checks should be used"
- CMD="./.ci/travis/travis.sh all-sevntu-checks"
# MacOS JDK8 verify (till cache is not working, we can not do verify)
- os: osx
osx_image: xcode9.3
env:
- DESC="MacOS JDK8 verify, site, assembly"
- CMD1="./.ci/travis/travis.sh osx-package"
- CMD2="./.ci/travis/travis.sh osx-assembly"
- CMD="$CMD1 && $CMD2"
# MacOS JDK11 verify (till cache is not working, we can not do verify)
- os: osx
osx_image: xcode10.1
env:
- DESC="MacOS JDK11 verify, site, assembly"
- CMD1="./.ci/travis/travis.sh osx-package"
- CMD2="./.ci/travis/travis.sh osx-assembly"
- CMD="$CMD1 && $CMD2"
# MacOS JDK13 verify (till cache is not working, we can not do verify)
- os: osx
osx_image: xcode11.2
env:
- DESC="MacOS JDK13 verify, site, assembly"
- CMD1="./.ci/travis/travis.sh osx-jdk13-package"
- CMD2="./.ci/travis/travis.sh osx-jdk13-assembly"
- CMD="$CMD1 && $CMD2"
# No error testing - simple-binary-encoding
- jdk: openjdk8
env:
- DESC="no error test on simple-binary-encoding"
- USE_MAVEN_REPO="true"
- CMD="./.ci/travis/travis.sh no-error-test-sbe"
# versions to update
- jdk: openjdk8
env:
- DESC="print versions to update"
- USE_MAVEN_REPO="true"
- CMD="./.ci/travis/travis.sh versions"
- SKIP_JOB_BY_FILES="false"
# OpenJDK11 verify
- jdk: openjdk11
env:
- DESC="verify with OpenJDK11"
- USE_MAVEN_REPO="true"
- CMD="mvn -e verify"
# OpenJDK11 assembly/site
- jdk: openjdk11
env:
- DESC="assembly/site with OpenJDK11"
- USE_MAVEN_REPO="true"
- CMD="mvn -e package -Passembly && mvn -e site -Dlinkcheck.skip=true"
# OpenJDK14 build
- jdk: openjdk14
env:
- DESC="build with OpenJDK14"
- USE_MAVEN_REPO="true"
- CMD="./.ci/travis/travis.sh jdk14-assembly-site"
# OpenJDK14 verify limited
- jdk: openjdk14
env:
- DESC="verify limited with OpenJDK14"
- USE_MAVEN_REPO="true"
- CMD="./.ci/travis/travis.sh jdk14-verify-limited"
# OpenJDK11 compile input files with jdk9 specific syntax
- jdk: openjdk11
env:
- DESC="compile input files with jdk9 specific syntax"
- CMD="./.ci/travis/travis.sh javac9"
# compile input files compilation that are not compiled by eclipse
- jdk: openjdk8
env:
- DESC="compile input files that are not compiled by eclipse"
- CMD="./.ci/travis/travis.sh javac8"
# OpenJDK14 compile input files with jdk14 specific syntax
- jdk: openjdk14
env:
- DESC="compile input files with jdk14 specific syntax"
- CMD="./.ci/travis/travis.sh javac14"
# find missing pitests
- env:
- DESC="find missing pitests"
- CMD="./.ci/travis/travis.sh check-missing-pitests"
# Ensure that all modules are used in no exception configs
- env:
- DESC="ensure that all modules are used in no exception configs"
- CMD="./.ci/travis/travis.sh verify-no-exception-configs"
- env:
- DESC="validate since javadoc tag if new module is created"
- CMD="./.ci/travis/travis.sh check-since-version"
# No error testing - pmd
- jdk: openjdk11
env:
- DESC="no error test on pmd"
- USE_MAVEN_REPO="true"
- CMD="./.ci/travis/travis.sh no-error-pmd"
# No violation testing - josm (ant task)
- jdk: openjdk11
env:
- DESC="no violation testing on josm"
- USE_MAVEN_REPO="true"
- CMD="./.ci/travis/travis.sh no-violation-test-josm"
script:
- SKIP_FILES1=".github|codeship-*|buddy.yml|appveyor.yml|circleci"
- SKIP_FILES2="|fast-forward-merge.sh|LICENSE|LICENSE.apache20|README.md|release.sh|RIGHTS.antlr"
- SKIP_FILES3="|shippable.yml|shippable.sh|wercker.yml|wercker.sh|intellij-idea-inspections.xml"
- SKIP_FILES4="|Jenkinsfile"
- SKIP_FILES=$SKIP_FILES1$SKIP_FILES2$SKIP_FILES3$SKIP_FILES4
- export RUN_JOB=1
# - source ./.ci/common.sh
# - |
# if [ -z ${SKIP_JOB_BY_FILES+x} ]; then
# SKIP_JOB_BY_FILES="recheck";
# fi
# should_run_job will change RUN_JOB variable
# - should_run_job $SKIP_JOB_BY_FILES $SKIP_FILES
- |
set -e
if [[ $RUN_JOB == 1 ]]; then
MVN_SETTINGS=${TRAVIS_HOME}/.m2/settings.xml
if [[ -f ${MVN_SETTINGS} ]]; then
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
sed -i'' -e "/<mirrors>/,/<\/mirrors>/ d" $MVN_SETTINGS
else
xmlstarlet ed --inplace -d "//mirrors" $MVN_SETTINGS
fi
fi
if [[ $USE_MAVEN_REPO == 'true' && ! -d "~/.m2" ]]; then
echo "Maven local repo cache is not found, initializing it ..."
mvn -e -B install -Pno-validations;
fi
echo "eval of CMD is starting";
echo "CMD=$CMD";
eval $CMD;
echo "eval of CMD is completed";
else
echo "CI is skipped";
fi
sleep 5s
after_success:
- |
set -e
if [[ -n $CMD_AFTER_SUCCESS
&& $RUN_JOB == 1
]];
then
echo "CMD_AFTER_SUCCESS is starting";
eval $CMD_AFTER_SUCCESS;
echo "CMD_AFTER_SUCCESS is finished";
fi
sleep 5s
- |
set -e
SKIP_DEPLOY=false
if [ $(git log -1 | grep -E "\[maven-release-plugin\] prepare release" | cat | wc -l) -lt 1 ];
then
SKIP_DEPLOY=false;
else
SKIP_DEPLOY=true;
fi;
if [[ $TRAVIS_REPO_SLUG == 'checkstyle/checkstyle'
&& $TRAVIS_BRANCH == 'master'
&& $TRAVIS_PULL_REQUEST == 'false'
&& $DEPLOY == 'true'
&& $RUN_JOB == 1
&& $SKIP_DEPLOY == 'false'
]];
then
mvn -e -s config/deploy-settings.xml -Pno-validations deploy;
echo "deploy to maven snapshot repository is finished";
fi
sleep 5s
- |
set -e
if [ "$(git status | grep 'Changes not staged\|Untracked files')" ]; then
printf "Please clean up or update .gitattributes file.\nGit status output:\n"
git status
sleep 5s
false
fi
- |
set -e
fail=0
mkdir -p .ci-temp
if [ -z "$(ls -A .ci-temp)" ]; then
echo "Folder .ci-temp/ is empty."
else
echo "Folder .ci-temp/ is not empty. Verification failed."
echo "Contents of .ci-temp/:"
fail=1
fi
ls -A .ci-temp
sleep 5s
exit $fail