-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
76 lines (61 loc) · 1.61 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
image: maven:latest
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
cache:
paths:
- .m2/repository
stages:
- build
- static-analysis
- test
- deploy
build:
stage: build
script:
- 'mvn $MAVEN_CLI_OPTS clean test-compile'
test-PTG:
stage: test
cache:
paths:
- .m2/repository
script:
- cd PTG
- 'mvn $MAVEN_CLI_OPTS -B install'
- 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/
artifacts:
paths:
- PTG/target/surefire-reports
reports:
junit:
- PTG/target/surefire-reports/TEST-*.xml
static-analysis-PTG:
stage: static-analysis
script:
- cd PTG
- "mvn $MAVEN_CLI_OPTS -B test-compile checkstyle:check"
- "mvn $MAVEN_CLI_OPTS -B pmd:check"
pages:
stage: deploy
only:
- master
- development
script:
- mv PTG/target/surefire-reports public/
artifacts:
paths:
- public
expire_in: 30 days
deploy:
stage: deploy
only:
- master
- development
script:
- 'mvn $MAVEN_CLI_OPTS clean install'
artifacts:
paths:
- PTG/target/PTG-1.0-SNAPSHOT-jar-with-dependencies.jar