-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
101 lines (94 loc) · 2.22 KB
/
.gitlab-ci.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
before_script:
- cp tracker.json /root/
- cd vendmachtrack/
- mvn clean install -DskipTests
stages:
- build
- lint
- test
- coverage-report
# - coverage-visualize
build:
stage: build
image: maven:3.9.4-amazoncorretto-20
script:
- mvn compile
only:
- merge_requests
checkstyle:
stage: lint
image: maven:3.9.4-amazoncorretto-20
script:
- mvn checkstyle:checkstyle -Dcheckstyle.failOnViolation=true
only:
- merge_requests
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/vendmachtrack/test-results/checkstyle/*.xml
expire_in: 1 week
needs:
- build
spotbugs:
stage: lint
image: maven:3.9.4-amazoncorretto-20
script:
- mvn com.github.spotbugs:spotbugs-maven-plugin:check
only:
- merge_requests
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/vendmachtrack/test-results/spotbugs/**/spotbugs.xml
expire_in: 1 week
needs:
- build
test:
stage: test
image: maven:3.9.4-amazoncorretto-20
script:
- mvn test -Pskip-graphical-ui-tests
only:
- merge_requests
artifacts:
when: always
reports:
junit: $CI_PROJECT_DIR/vendmachtrack/test-results/junit/**/*xml
expire_in: 1 week
needs:
- build
verify:
stage: coverage-report
image: maven:3.9.4-amazoncorretto-20
script:
- mvn verify -Pskip-graphical-ui-tests
- cat $CI_PROJECT_DIR/vendmachtrack/test-results/jacoco/index.html | grep -o 'Total[^%]*%'
coverage: '/<td class="ctr2">(\d+%)/'
only:
- merge_requests
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/vendmachtrack/test-results/jacoco/
expire_in: 1 week
needs:
- build
- checkstyle
- spotbugs
- test
#visualize:
# stage: coverage-visualize
# image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.9
# script:
# - python /opt/cover2cover.py $CI_PROJECT_DIR/vendmachtrack/test-results/jacoco/jacoco.xml $CI_PROJECT_DIR/ > $CI_PROJECT_DIR/vendmachtrack/test-results/jacoco/cobertura/cobertura.xml
# artifacts:
# reports:
# coverage_report:
# coverage_format: cobertura
# path: $CI_PROJECT_DIR/vendmachtrack/test-results/jacoco/cobertura/cobertura.xml
# needs:
# - build
# - checkstyle
# - spotbugs
# - test
# - verify