-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
193 lines (171 loc) · 4.85 KB
/
.gitlab-ci.yml
File metadata and controls
193 lines (171 loc) · 4.85 KB
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
stages:
- build
- test
- package
- deploy
variables:
# Activate remote debug server during integration test on specified port
# DEBUG: <port>
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_DYN_CLI_OPTS: '--batch-mode --errors --fail-at-end --show-version $([ -n "$DEBUG" ] && echo "-Dit.debug.remote=$DEBUG")'
MAVEN_CLI_OPTS: 'echo "$MAVEN_DYN_CLI_OPTS"'
JDK_AGENT_VERSION: "maven:3.5-jdk-8"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_REF_NAME"'
cache:
paths:
- .m2/repository
.build: &build
image: $JDK_AGENT_VERSION
stage: build
build-benchmark:
<<: *build
script: "mvn package `eval $MAVEN_CLI_OPTS` -DfinalName=build"
artifacts:
paths:
- target/*.jar
expire_in: 20 minutes
package-jdk8:
<<: *build
script: "mvn verify `eval $MAVEN_CLI_OPTS`"
artifacts:
paths:
- target/*.jar
- target/site/jacoco
- target/jacoco.exec
- target/surefire-reports
.test: &test
stage: test
script: "mvn verify `eval $MAVEN_CLI_OPTS` \
-P skip-jar -DskipUTs \
-Dmaven.javadoc.skip=true \
-Dmaven.source.skip=true \
-Dmaven.javadoc.skip=true \
-Dassembly.skipAssembly=true \
-Djacoco.skip=true"
dependencies:
- package-jdk8
test-jre8:
<<: *test
image: maven:3.5-jdk-8-slim
test-jre9:
<<: *test
image: maven:3.5-jdk-9-slim
test-jre10:
<<: *test
image: maven:3.5-jdk-10-slim
test-jre8-ibm:
<<: *test
image: maven:3.5-ibmjava-8-alpine
.benchmark: &benchmark
stage: test
variables:
JAVA_ARGS: ""
JMH_MAIN_ARGS: ""
# We don't care about the precision of the benchmark. We just want to get it run to test the benchmark pipeline
JMH_TEST_ARGS: "-wi 1 -i 1"
script:
- mkdir -p target/benchmark
- name=$(echo "${CI_JOB_NAME}" | tail -c +11)
- '[ "$CI_COMMIT_REF_NAME" = "master" -o -n "$CI_COMMIT_TAG" ] && jmhArgs="$JMH_MAIN_ARGS" || jmhArgs="$JMH_TEST_ARGS"'
- java ${JAVA_ARGS}
-jar target/build-benchmarks.jar
${jmhArgs}
-foe true
-rf json -rff target/benchmark/${name}.json
| tee target/benchmark/${name}.log
dependencies:
- build-benchmark
artifacts:
paths:
- target/benchmark
benchmark-jre8:
<<: *benchmark
image: maven:3.5-jdk-8-slim
benchmark-jre9:
<<: *benchmark
variables:
JAVA_ARGS: "-Djdk.attach.allowAttachSelf=true --illegal-access=warn"
image: maven:3.5-jdk-9-slim
benchmark-jre10:
<<: *benchmark
variables:
JAVA_ARGS: "-Djdk.attach.allowAttachSelf=true --illegal-access=warn"
image: maven:3.5-jdk-10-slim
benchmark-jre8-ibm:
<<: *benchmark
variables:
JAVA_ARGS: "-Dcom.ibm.tools.attach.directory=/tmp -Djava.io.tmpdir=/tmp"
image: maven:3.5-ibmjava-8-alpine
coverage-rate:
image: alpine:3.7
stage: package
dependencies:
- package-jdk8
script:
- awk -F"," \
'{
instructions += $4 + $5;
covered += $5
}
END
{
print covered, "/", instructions, "instructions covered";
print 100*covered/instructions, "% covered"
}' target/site/jacoco/jacoco.csv
benchmark-report:
image: gradle:alpine
stage: package
dependencies:
- benchmark-jre8
- benchmark-jre9
- benchmark-jre10
- benchmark-jre8-ibm
script:
# Use benchmark-reports as output directory because the target directory is RO under this gradle docker image
- for json in $(ls target/benchmark | grep ".json"); do
name=$(echo $json | head -c -6);
mkdir -p "benchmark-reports/$name";
gradle jmhReport
-PreportInput="target/benchmark/$json"
-PreportOutput="benchmark-reports/$name/";
done
artifacts:
paths:
- benchmark-reports
quality:
image: $JDK_AGENT_VERSION
stage: test
dependencies:
- package-jdk8
allow_failure: true
script:
- mvn compile # Sonar needs compile classes
- mvn sonar:sonar
-Dsonar.organization=turpif-github
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=${SONAR_TOKEN}
-Dsonar.junit.reportPaths=target/surefire-reports
-Dsonar.jacoco.reportPaths=target/jacoco.exec
only:
- master
- tags
pages:
image: alpine:3.7
stage: deploy
dependencies:
- package-jdk8
- benchmark-report
script:
- mkdir -p public/coverage
- mkdir -p public/benchmark
- cp -rf target/site/jacoco/* public/coverage
- cp -rf benchmark-reports/* public/benchmark
artifacts:
paths:
- public
only:
- master
- tags