Skip to content

Commit 123df2f

Browse files
committed
Update .gitlab-ci.yml file to show coverage
1 parent 680e771 commit 123df2f

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.gitlab-ci.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
11
stages:
22
- build
3-
# - test
3+
- test
4+
- visualize
45
- checkstyle
56

67
build:
78
image: maven:3.8-openjdk-17
89
stage: build
910
script:
10-
- mvn clean package -pl rosetta-xcore-plugin-dependencies,rosetta-lang,com.regnosys.rosetta.interpreternew,rosetta-testing
11+
- mvn -D"maven.test.skip=true" clean package -pl rosetta-xcore-plugin-dependencies,rosetta-lang,rosetta-testing,com.regnosys.rosetta.interpreternew
1112

1213

1314

1415
# test:
1516
# image: maven:3.8-openjdk-17
1617
# stage: test
1718
# script:
18-
# - mvn test -Dtest="/com.regnosys.rosetta.tests/src/test/java/com/regnosys/rosetta/interpreternew/*.java" -Dsurefire.failIfNoSpecifiedTests=false
19+
# - mvn test -pl rosetta-testing
20+
21+
test-jdk17:
22+
stage: test
23+
image: maven:3.8-openjdk-17
24+
script:
25+
- mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report -pl com.regnosys.rosetta.interpreternew
26+
artifacts:
27+
paths:
28+
- target/site/jacoco/jacoco.xml
29+
30+
coverage-jdk17:
31+
# Must be in a stage later than test-jdk17's stage.
32+
# The `visualize` stage does not exist by default.
33+
# Please define it first, or choose an existing stage like `deploy`.
34+
stage: visualize
35+
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.9
36+
script:
37+
# convert report from jacoco to cobertura, using relative project path
38+
- python /opt/cover2cover.py com.regnosys.rosetta.interpreternew/target/site/jacoco/jacoco.xml com.regnosys.rosetta.interpreternew/src/main/java/ > com.regnosys.rosetta.interpreternew/target/site/cobertura.xml
39+
needs: ["test-jdk17"]
40+
artifacts:
41+
reports:
42+
coverage_report:
43+
coverage_format: cobertura
44+
path: com.regnosys.rosetta.interpreternew/target/site/cobertura.xml
1945

2046
checkstyle:
2147
image: maven:3.8-openjdk-17

0 commit comments

Comments
 (0)