forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
360 lines (343 loc) · 21 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
language: java
sudo: false
cache:
directories:
- ~/.m2
branches:
only:
- master
install:
-
matrix:
fast_finish: true
include:
# unit tests (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests and deploy" CMD="mvn clean integration-test failsafe:verify" COVERAGE_CMD="" DEPLOY="true"
# checkstyle (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="checkstyle and sevntu-checkstyle"
- CMD="mvn clean verify -DskipTests -DskipITs -Dpmd.skip=true -Dfindbugs.skip=true -Dcobertura.skip=true"
- COVERAGE_CMD=""
# cobertura and codecov (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="cobertura and codecov"
- CMD="mvn clean compile cobertura:check cobertura:cobertura"
- COVERAGE_CMD="bash <(curl -s https://codecov.io/bash)"
# findbugs and pmd (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="findbugs and pmd"
- CMD="mvn clean compile pmd:check findbugs:check"
- COVERAGE_CMD=""
# site (oraclejdk8 as 'site' success is required to be sure that on release time all will be ok, admins will use oracle8 version)
# moved to https://codeship.com/projects/124310/configure_tests
#- jdk: oraclejdk8
# env:
# - DESC="site"
# - CMD1="mvn clean site -Dlinkcheck.skip=true -DskipTests -DskipITs "
# - CMD2=" -Dpmd.skip=true -Dfindbugs.skip=true -Dcobertura.skip=true "
# - CMD3=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true"
# - CMD=$CMD1$CMD2$CMD3
# - COVERAGE_CMD=""
# assembly (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="assembly & run '-all' jar"
- CMD1="mvn clean package -Passembly"
- CMD2=" && CS_POM_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)"
- CMD3=" && echo version:\$CS_POM_VERSION"
- CMD4=" && java -jar target/checkstyle-\$CS_POM_VERSION-all.jar -c /google_checks.xml"
- CMD5=" src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/InputNoLineWrapGood.java > output.log"
- CMD6=" && if grep -vE '(Starting audit)|(warning)|(Audit done.)' output.log ; then exit 1; fi "
- CMD7=" && if grep 'warning' output.log ; then exit 1; fi"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7
- COVERAGE_CMD=""
# nemo.sonarqube.com (oraclejdk7)
- jdk: oraclejdk7
env:
- DESC="nemo.sonarqube.com"
- CMD1="mvn clean install cobertura:cobertura -Dcobertura.report.format=xml "
- CMD2=" -Dmaven.test.failure.ignore=true -V -Dcheckstyle.skip=true "
- CMD3=" -Dpmd.skip=true -Dcheckstyle.ant.skip=true"
- CMD=$CMD1$CMD2$CMD3
- COVERAGE_CMD=""
# NoErrorTest - Orekit (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoErrorTest - Orekit"
- CMD1="mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD2=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD3=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD4=" && CS_POM_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)"
- CMD5=" && echo CS_version:\$CS_POM_VERSION"
- CMD6=" && git clone https://github.com/checkstyle/Orekit.git && cd Orekit"
- CMD7=" && mvn compile checkstyle:check -Dorekit.checkstyle.version=\$CS_POM_VERSION"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7
- COVERAGE_CMD=""
# NoErrorTest - XWiki (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoErrorTest - XWiki"
- CMD1="mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true"
- CMD2=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD3=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD4=" && CS_POM_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)"
- CMD5=" && echo CS_version:\$CS_POM_VERSION"
- CMD6=" && git clone https://github.com/xwiki/xwiki-commons/ "
- CMD7=" && cd xwiki-commons/xwiki-commons-core && git checkout xwiki-commons-8.0-milestone-1 "
- CS_CMD=" && mvn install -DskipTests -Dxwiki.clirr.skip=true checkstyle:check -Dcheckstyle.version=\$CS_POM_VERSION"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CS_CMD
- COVERAGE_CMD=""
# NoExceptiontest - Checkstyle, sevntu-checkstyle (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - Checkstyle, sevntu-checkstyle"
- CMD1="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester "
- CMD2=" && sed -i.'' 's/^guava/#guava/' projects-for-travis.properties "
- CMD3=" && sed -i.'' 's/#checkstyle/checkstyle/' projects-for-travis.properties "
- CMD4=" && sed -i.'' 's/#sevntu-checkstyle/sevntu-checkstyle/' projects-for-travis.properties "
- CMD5=" && sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh "
- CMD6=" && cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD7=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD8=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD9=" && cd contribution/checkstyle-tester "
- CMD10=" && ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9$CMD10
- COVERAGE_CMD=""
# NoExceptiontest - Guava (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - Guava"
- CMD1="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester"
- CMD2=" && sed -i.'' 's/^guava/#guava/' projects-for-travis.properties"
- CMD3=" && sed -i.'' 's/#guava/guava/' projects-for-travis.properties"
- CMD4=" && sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh"
- CMD5=" && cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true"
- CMD6=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD7=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD8=" && cd contribution/checkstyle-tester "
- CMD9=" && ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9
- COVERAGE_CMD=""
# NoExceptionTest - Hibernate ORM (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - Hibernate ORM"
- CMD1="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester "
- CMD2="&& sed -i.'' 's/^guava/#guava/' projects-for-travis.properties "
- CMD3="&& sed -i.'' 's/#hibernate-orm/hibernate-orm/' projects-for-travis.properties "
- CMD4="&& sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh "
- CMD5="&& cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD6=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD7=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD8="&& cd contribution/checkstyle-tester "
- CMD9="&& ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9
- COVERAGE_CMD=""
# NoExceptionTest - FindBugs (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - FindBugs"
- CMD1="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester "
- CMD2="&& sed -i.'' 's/^guava/#guava/' projects-for-travis.properties "
- CMD3="&& sed -i.'' 's/#findbugs/findbugs/' projects-for-travis.properties "
- CMD4="&& sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh "
- CMD5="&& cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD6=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD7=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD8="&& cd contribution/checkstyle-tester "
- CMD9="&& ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9
- COVERAGE_CMD=""
# NoExceptionTest - Pmd,elasticsearch,lombok-ast (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - Pmd,elasticsearch,lombok-ast"
- CMD1="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester "
- CMD2="&& sed -i.'' 's/^guava/#guava/' projects-for-travis.properties "
- CMD3="&& sed -i.'' 's/#pmd/pmd/' projects-for-travis.properties "
- CMD4="&& sed -i.'' 's/#elasticsearch/elasticsearch/' projects-for-travis.properties "
- CMD5="&& sed -i.'' 's/#lombok-ast/lombok-ast/' projects-for-travis.properties "
- CMD6="&& sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh "
- CMD7="&& cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD8=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD9=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD10="&& cd contribution/checkstyle-tester "
- CMD11="&& ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9$CMD10$CMD11
- COVERAGE_CMD=""
# NoExceptionTest - RxJava,java-design-patterns,MaterialDesignLibrary,apache-ant,apache-jsecurity,android-launcher (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - RxJava,java-design-patterns,MaterialDesignLibrary,apache-ant,apache-jsecurity,android-launcher"
- CMD01="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester "
- CMD02="&& sed -i.'' 's/^guava/#guava/' projects-for-travis.properties "
- CMD03="&& sed -i.'' 's/#RxJava/RxJava/' projects-for-travis.properties "
- CMD04="&& sed -i.'' 's/#java-design-patterns/java-design-patterns/' projects-for-travis.properties "
- CMD05="&& sed -i.'' 's/#MaterialDesignLibrary/MaterialDesignLibrary/' projects-for-travis.properties "
- CMD06="&& sed -i.'' 's/#apache-ant/apache-ant/' projects-for-travis.properties "
- CMD07="&& sed -i.'' 's/#apache-jsecurity/apache-jsecurity/' projects-for-travis.properties "
- CMD08="&& sed -i.'' 's/#android-launcher/android-launcher/' projects-for-travis.properties "
- CMD09="&& sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh "
- CMD10="&& cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD11=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD12=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD13="&& cd contribution/checkstyle-tester "
- CMD14="&& ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD01$CMD02$CMD03$CMD04$CMD05$CMD06$CMD07$CMD08$CMD09$CMD10$CMD11$CMD12$CMD13$CMD14
- COVERAGE_CMD=""
# NoExceptionTest - Spring (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - Spring"
- CMD1="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester"
- CMD2=" && sed -i.'' 's/^guava/#guava/' projects-for-travis.properties "
- CMD3=" && sed -i.'' 's/#spring-framework/spring-framework/' projects-for-travis.properties "
- CMD4=" && sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh "
- CMD5=" && cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD6=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD7=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD8=" && cd contribution/checkstyle-tester "
- CMD9=" && ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9
- COVERAGE_CMD=""
# NoExceptionTest - Hbase (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - Hbase"
- CMD1="git clone https://github.com/checkstyle/contribution && cd contribution/checkstyle-tester "
- CMD2="&& sed -i.'' 's/^guava/#guava/' projects-for-travis.properties "
- CMD3="&& sed -i.'' 's/#Hbase/Hbase/' projects-for-travis.properties "
- CMD4="&& sed -i.'' 's/projects-to-test-on.properties/projects-for-travis.properties/' launch.sh "
- CMD5="&& cd ../../ && mvn clean install -DskipTests -DskipITs -Dcobertura.skip=true "
- CMD6=" -Dpmd.skip=true -Dfindbugs.skip=true "
- CMD7=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true"
- CMD8="&& cd contribution/checkstyle-tester "
- CMD9="&& ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9
- COVERAGE_CMD=""
# release dry run (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="release dry run"
- CMD1="mvn release:prepare -DdryRun=true --batch-mode -Darguments='-DskipTests -DskipITs "
- CMD2=" -Dcobertura.skip=true -Dpmd.skip=true -Dfindbugs.skip=true -Dxml.skip=true"
- CMD3=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dgpg.skip=true'"
- CMD=$CMD1$CMD2$CMD3
- COVERAGE_CMD=""
# unit tests in German locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests de" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=de -Duser.country=DE -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests in Spanish locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests es" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=es -Duser.country=ES -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests in Finnish locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests fi" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=fi -Duser.country=FI -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests in French locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests fr" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=fr -Duser.country=FR -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests in Chinese locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests zh" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=zh -Duser.country=CN -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests in Japanese locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests ja" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=ja -Duser.country=JP -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests in Portuguese locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests pt" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=pt -Duser.country=PT -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests in Turkish locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests tr" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=tr -Duser.country=TR -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests (openjdk7, oraclejdk7)
- jdk: openjdk7
env: DESC="tests" CMD="mvn clean integration-test failsafe:verify" COVERAGE_CMD=""
- jdk: oraclejdk7
env: DESC="tests" CMD="mvn clean integration-test failsafe:verify" COVERAGE_CMD=""
# checkstyle (openjdk7, oraclejdk7)
- jdk: openjdk7
env:
- DESC="checkstyle and sevntu-checkstyle"
- CMD="mvn clean verify -DskipTests -DskipITs -Dpmd.skip=true -Dfindbugs.skip=true -Dcobertura.skip=true"
- COVERAGE_CMD=""
- jdk: oraclejdk7
env:
- DESC="checkstyle and sevntu-checkstyle"
- CMD="mvn clean verify -DskipTests -DskipITs -Dpmd.skip=true -Dfindbugs.skip=true -Dcobertura.skip=true"
- COVERAGE_CMD=""
# MacOS verify (till cache is not working, we can not do verify)
- os: osx
env:
- DESC="MacOS tests only"
- CMD="export JAVA_HOME=$(/usr/libexec/java_home) && mvn clean integration-test failsafe:verify "
- COVERAGE_CMD=""
# Releasenotes generation - validaton
- jdk: oraclejdk8
env:
- DESC="Releasenotes generation"
- CMD0="if [[ $TRAVIS_PULL_REQUEST =~ ^([0-9]*)$ ]]; then exit 0; fi "
- CMD1=" && git clone https://github.com/checkstyle/contribution && cd contribution/releasenotes-xdoc-builder "
- CMD2=" && mvn clean compile package "
- CMD3=" && cd ../../ && git clone https://github.com/checkstyle/checkstyle && cd checkstyle "
- CMD4=" && LATEST_RELEASE_TAG=\$(git describe \$(git rev-list --tags --max-count=1)) && cd ../"
- CMD5=" && CS_RELEASE_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec | sed 's/-SNAPSHOT//' ) "
- CMD6=" && echo LATEST_RELEASE_TAG=\$LATEST_RELEASE_TAG && echo CS_RELEASE_VERSION=\$CS_RELEASE_VERSION "
- CMD7=" && java -jar contribution/releasenotes-xdoc-builder/target/releasenotes-xdoc-builder-1.0-all.jar "
- CMD8=" -localRepoPath checkstyle -startRef \$LATEST_RELEASE_TAG -releaseNumber \$CS_RELEASE_VERSION -authToken $GITHUB_AUTH_TOKEN"
- CMD9=" && cat releasenotes.xml "
- CMD=$CMD0$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9
- COVERAGE_CMD=""
# java 8 compile (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="compile inputs by java 8"
- CMD="javac \$(grep -rl --include='*.java' '//Compilable with Java8' src/test/resources-noncompilable)"
- COVERAGE_CMD=""
# testing of PR format
- env:
- DESC="test Issue ref in PR description"
- CMD0="if [[ ! $TRAVIS_PULL_REQUEST =~ ^([0-9]*)$ ]]; then exit 0; fi "
- CMD1=" && LINK_COMMITS=https://api.github.com/repos/checkstyle/checkstyle/pulls/$TRAVIS_PULL_REQUEST/commits "
- CMD2=" && COMMITS=\$(curl -s -H 'Authorization: token $GITHUB_AUTH_TOKEN' \$LINK_COMMITS | jq '.[0] | .commit.message') "
- CMD3=" && echo 'Messages from github:'\${COMMITS:0:60}... "
- CMD4=" && ISSUE_NUMBER=\$( echo \$COMMITS | sed -e 's/^.*Issue //' | sed -e 's/:.*//') "
- CMD5=" && echo 'Issue number:'\$ISSUE_NUMBER && RESULT=0"
- CMD6=" && if [[ \$ISSUE_NUMBER =~ ^#[0-9]+$ ]]; then "
- CMD7=" LINK_PR=https://api.github.com/repos/checkstyle/checkstyle/pulls/$TRAVIS_PULL_REQUEST "
- CMD8=" && LINK_ISSUE=https://api.github.com/repos/checkstyle/checkstyle/issues/\${ISSUE_NUMBER:1} "
- CMD9=" && REGEXP=(\$ISSUE_NUMBER\|https://github.com/checkstyle/checkstyle/issues/\${ISSUE_NUMBER:1})"
- CMD10=" && PR_DESC=\$(curl -s -H 'Authorization: token $GITHUB_AUTH_TOKEN' \$LINK_PR | jq '.body' | grep -E \$REGEXP | cat ) "
- CMD11=" && echo 'PR Description grepped:'\${PR_DESC:0:80} "
- CMD12=" && if [[ -z \$PR_DESC ]]; then "
- CMD13=" echo 'Please put a reference of Issue to PR description, this will bind Issue and PR in Github' && RESULT=1; "
- CMD14=" fi "
- CMD15=" && LABEL_APRV=\$(curl -s -H 'Authorization: token $GITHUB_AUTH_TOKEN' \$LINK_ISSUE | jq '.labels [] | .name' | grep approved | cat | wc -l ) "
- CMD16=" && if [[ \$LABEL_APRV == 0 ]]; then "
- CMD17=" echo 'You provide PR to Issue that is not approved yes, please ask admins to approve your issue first' && RESULT=1; "
- CMD18=" fi "
- CMD19=" fi "
- CMD20=" && if [[ \$RESULT == 0 ]]; then "
- CMD21=" echo 'PR validation succeed.'; "
- CMD22=" else "
- CMD23=" echo 'PR validation failed.' && false; "
- CMD24=" fi "
- CMD=$CMD0$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7$CMD8$CMD9$CMD10$CMD11$CMD12$CMD13$CMD14$CMD15
- CMD=$CMD$CMD16$CMD17$CMD18$CMD19$CMD20$CMD21$CMD22$CMD23$CMD24
- COVERAGE_CMD=""
script: eval $CMD
after_success:
- eval $COVERAGE_CMD
- >-
if [[ $TRAVIS_REPO_SLUG == 'checkstyle/checkstyle'
&& $TRAVIS_BRANCH == 'master'
&& $TRAVIS_PULL_REQUEST == 'false'
&& $DEPLOY == 'true'
]];
then
mvn -s config/deploy-settings.xml deploy \
-DskipTests -DskipITs -Dpmd.skip=true -Dfindbugs.skip=true \
-Dcobertura.skip=true -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dxml.skip=true ;
fi