-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
76 lines (69 loc) · 1.93 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
76 lines (69 loc) · 1.93 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
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"
JDK17_IMAGE: "maven:3.9.5-eclipse-temurin-17"
JDK21_IMAGE: "maven:3.9.5-eclipse-temurin-21"
cache:
paths:
- .m2/repository
test:jdk17:
image: $JDK17_IMAGE
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
test:jdk21:
image: $JDK21_IMAGE
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS clean test'
only:
- branches
coverage:jdk17:
stage: visualize
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.9
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:
image: $JDK17_IMAGE
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS clean checkstyle:check'
only:
- branches
deploy:jdk17:
image: $JDK17_IMAGE
stage: deploy
script:
- 'cp $SETTINGS_XML ~/.m2/settings.xml'
- 'mvn $MAVEN_CLI_OPTS clean deploy -DskipTests'
only:
- tags
stages:
- test
- visualize
- build
- deploy