OCT 1. 更新 gitlab-ci 配置, 增加代码覆盖率

This commit is contained in:
黄昕 2024-03-06 10:38:41 +08:00
parent 69bbceacfe
commit daa09beec6
1 changed files with 20 additions and 0 deletions

View File

@ -3,6 +3,7 @@ stages :
- sonarqube-check
- compile
- integration-test
- coverage
- package
sonarqube-check :
@ -54,11 +55,30 @@ integration-test:
- target/surefire-reports/TEST-*.xml
- target/failsafe-reports/TEST-*.xml
coverage:
# Must be in a stage later than test-jdk11's stage.
# The `visualize` stage does not exist by default.
# Please define it first, or choose an existing stage like `deploy`.
stage: coverage
tags:
- linux-maven
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
script:
# convert report from jacoco to cobertura, using relative project path
- python /opt/cover2cover.py target/site/jacoco/jacoco.xml $CI_PROJECT_DIR/src/main/java/ > target/site/cobertura.xml
needs: ["integration-test"]
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: target/site/cobertura.xml
# 打包
package :
stage : package
tags :
- linux-maven
needs: ["coverage"]
only :
- master
script: