-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
65 lines (58 loc) · 1.69 KB
/
.gitlab-ci.yml
File metadata and controls
65 lines (58 loc) · 1.69 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
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
image: maven:3.8.5-openjdk-17
cache:
paths:
- .m2/repository
test:jdk17:
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report'
artifacts:
when: always
paths:
- target/site/jacoco/jacoco.xml
- target/site/jacoco/index.html
reports:
junit:
- target/surefire-reports/TEST-*.xml
- target/failsafe-reports/TEST-*.xml
only:
- branches
coverage:jdk17:
stage: visualize
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.10
coverage: '/Total.*?([0-9]{1,3})%/'
script:
- 'python /opt/cover2cover.py target/site/jacoco/jacoco.xml $CI_PROJECT_DIR/src/main/java/ > target/site/cobertura.xml'
- 'python /opt/source2filename.py target/site/cobertura.xml'
- 'cat target/site/jacoco/index.html'
needs: ["test:jdk17"]
dependencies:
- test:jdk17
artifacts:
reports:
coverage_report:
path: target/site/cobertura.xml
coverage_format: cobertura
except:
- tags
lint:jdk17:
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS clean checkstyle:check'
only:
- branches
deploy:jdk17:
stage: deploy
script:
- 'cp $SETTINGS_XML ~/.m2/settings.xml'
- 'mvn $MAVEN_CLI_OPTS clean deploy -DskipTests'
only:
- tags
stages:
- test
- visualize
- build
- deploy