Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit f9e10d8

Browse files
committed
Split test and coverage tasks
1 parent a9e0a43 commit f9e10d8

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.gitlab-ci.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cache:
1414
stages:
1515
- build
1616
- test
17+
- verify
1718
- deploy
1819

1920
build:
@@ -27,11 +28,26 @@ test:
2728
stage: test
2829
script:
2930
- mvn $MAVEN_CLI_OPTS verify
31+
artifacts:
32+
reports:
33+
junit:
34+
- target/surefire-reports/TEST-*.xml
35+
- target/failsafe-reports/TEST-*.xml
36+
37+
coverage:
38+
stage: verify
39+
script:
3040
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' target/site/jacoco/jacoco.csv
31-
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r target/site/jacoco/jacoco.xml
3241
coverage: '/(\d+\.?\d*) \% covered/'
33-
except:
34-
- tags
42+
rules:
43+
- if: $CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH
44+
45+
codacy:
46+
stage: verify
47+
script:
48+
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r target/site/jacoco/jacoco.xml
49+
rules:
50+
- if: $CODACY_PROJECT_TOKEN
3551

3652
sast:
3753
stage: test

0 commit comments

Comments
 (0)