This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
74 lines (66 loc) · 1.64 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
image: maven:3.6-jdk-12-alpine
variables:
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
MAVEN_CLI_OPTS: "--batch-mode --show-version -P ci"
cache:
paths:
- .m2/repository
- Simulator/target/
stages:
- build
- test
- prepare
- deploy
⚙maven-build:
stage: build
script:
- cd Simulator
- mvn $MAVEN_CLI_OPTS compile
🧪junit-test:
stage: test
script:
- cd Simulator
- mvn $MAVEN_CLI_OPTS -B test
- 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:
- Simulator/target/site/jacoco/
expire_in: 30 days
📖javadoc:
stage: prepare
script:
- cd Simulator
- mvn $MAVEN_CLI_OPTS -DskipTests=true -B javadoc:javadoc
artifacts:
paths:
- Simulator/target/site/apidocs
expire_in: 30 days
⏯build-jar:
stage: prepare
script:
- cd Simulator
- mvn $MAVEN_CLI_OPTS -DskipTests=true -B package
- cp target/Simulator.jar Simulator.jar
artifacts:
paths:
- Simulator/instance.json
- Simulator/Simulator.jar
- Simulator/native
expire_in: 30 days
pages:
stage: deploy
script:
- mkdir .public
- mkdir .public/jacoco
- mkdir .public/javadoc
- cp -r Simulator/target/site/jacoco/* .public/jacoco
- cp -r Simulator/target/site/apidocs/* .public/javadoc
- cp Simulator/gitlab-pages.html .public/index.html
- mv .public public
artifacts:
paths:
- public
# expire_in: 30 days
only:
- master