This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
76 lines (65 loc) · 1.65 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
variables:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
image: maven:3-openjdk-11
include:
- template: Security/SAST.gitlab-ci.yml
cache:
paths:
- .m2/repository
- target
stages:
- build
- test
- verify
- deploy
build:
stage: build
script:
- ./mvnw $MAVEN_CLI_OPTS compile
except:
- tags
test:
stage: test
script:
- ./mvnw $MAVEN_CLI_OPTS verify
artifacts:
reports:
junit:
- target/surefire-reports/TEST-*.xml
- target/failsafe-reports/TEST-*.xml
sast:
stage: test
variables:
SAST_EXCLUDED_PATHS: jacoco-resources,prism.js
coverage:
stage: verify
script:
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' target/site/jacoco/jacoco.csv
coverage: '/(\d+\.?\d*) \% covered/'
rules:
- if: $CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH && $CI_COMMIT_TAG == null
codacy:
stage: verify
script:
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r target/site/jacoco/jacoco.xml
rules:
- if: $CODACY_PROJECT_TOKEN && $CI_COMMIT_TAG == null
release:
stage: deploy
script:
- ./mvnw $MAVEN_CLI_OPTS -s ci_settings.xml clean deploy -Dchangelist= -ntp -Psources,javadocs,sign-and-deploy
only:
- tags
pages:
stage: deploy
script:
- cp changelog.md src/site/markdown
- ./mvnw clean verify site -Dchangelist= -Pjavadocs
- mv target/site public
- mv target/apidocs public
- mv public/images/favicon.ico public
artifacts:
paths:
- public
only:
- tags