forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
209 lines (190 loc) · 6.19 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
version: ~> 1.0
dist: xenial
os: linux
language: java
cache:
directories:
- ~/.m2
addons:
apt:
packages:
- xsltproc
- xmlstarlet
- ruby
branches:
only:
- master
install:
- gem install chef-utils:16.6.14 mdl
jobs:
fast_finish: true
include:
# this job do deploy maven repository
# unit tests (openjdk8)
- jdk: openjdk8
env:
- DESC="tests and deploy"
- CMD="mvn -e --no-transfer-progress clean integration-test failsafe:verify
-DargLine='-Xms1024m -Xmx2048m'"
- DEPLOY="true"
- USE_MAVEN_REPO="true"
# until https://github.com/checkstyle/checkstyle/issues/9984
# Ensure that all modules are used in no exception configs
# - env:
# - DESC="ensure that all modules are used in no exception configs"
# - CMD1="export PULL_REQUEST=$TRAVIS_PULL_REQUEST"
# - CMD2="./.ci/travis/validation.sh verify-no-exception-configs"
# - CMD="$CMD1 && $CMD2"
- jdk: openjdk8
env:
- DESC="NoErrorTest - Postgresql JDBC Driver"
- CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
- CMD2="./.ci/wercker.sh no-error-pgjdbc"
- CMD="$CMD1 && $CMD2"
- USE_MAVEN_REPO="true"
- jdk: openjdk8
env:
- DESC="NoErrorTest - Orekit"
- CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
- CMD2="./.ci/wercker.sh no-error-orekit"
- CMD="$CMD1 && $CMD2"
- USE_MAVEN_REPO="true"
# until https://github.com/checkstyle/checkstyle/issues/10778
# - jdk: openjdk8
# env:
# - DESC="NoErrorTest - Hibernate Search"
# - CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
# - CMD2="./.ci/wercker.sh no-error-hibernate-search"
# - CMD="$CMD1 && $CMD2"
# - USE_MAVEN_REPO="true"
# until https://github.com/sevntu-checkstyle/sevntu.checkstyle/pull/858
# - jdk: openjdk8
# env:
# - DESC="NoErrorTest - checkstyle's sevntu"
# - CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
# - CMD2="./.ci/wercker.sh no-error-checkstyles-sevntu"
# - CMD="$CMD1 && $CMD2"
# - USE_MAVEN_REPO="true"
- jdk: openjdk8
env:
- DESC="NoErrorTest - sevntu-checks"
- CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
- CMD2="./.ci/wercker.sh no-error-sevntu-checks"
- CMD="$CMD1 && $CMD2"
- USE_MAVEN_REPO="true"
- jdk: openjdk8
env:
- DESC="NoErrorTest - contribution"
- CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
- CMD2="./.ci/wercker.sh no-error-contribution"
- CMD="$CMD1 && $CMD2"
- USE_MAVEN_REPO="true"
- jdk: openjdk8
env:
- DESC="NoErrorTest - methods distance"
- CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
- CMD2="./.ci/wercker.sh no-error-methods-distance"
- CMD="$CMD1 && $CMD2"
- USE_MAVEN_REPO="true"
- jdk: openjdk8
env:
- DESC="NoErrorTest - Spring Cloud GCP"
- CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
- CMD2="./.ci/wercker.sh no-error-spring-cloud-gcp"
- CMD="$CMD1 && $CMD2"
- USE_MAVEN_REPO="true"
- jdk: openjdk8
env:
- DESC="NoErrorTest - EqualsVerifier"
- CMD1="mvn -e --no-transfer-progress clean install -Pno-validations"
- CMD2="./.ci/wercker.sh no-error-equalsverifier"
- CMD="$CMD1 && $CMD2"
- USE_MAVEN_REPO="true"
script:
- SKIP_FILES1=".github|codeship-*|appveyor.yml|circleci"
- SKIP_FILES2="|fast-forward-merge.sh|LICENSE|LICENSE.apache20|README.md|release.sh|RIGHTS.antlr"
- SKIP_FILES3="|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
- |
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 --no-transfer-progress -B install -Pno-validations;
mvn -e --no-transfer-progress clean;
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 --no-transfer-progress -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
printf "Top 300 lines of diff:\n"
git diff | head -n 300
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