This repository has been archived by the owner on Oct 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
56 lines (47 loc) · 1.77 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
variables:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
image: maven:3-openjdk-11
cache:
paths:
- .m2/repository
- .mvn/wrapper
- 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
coverage:
stage: verify
script:
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' monobank4j-gson/target/site/jacoco/jacoco.csv monobank4j-jackson/target/site/jacoco/jacoco.csv monobank4j-jackson-jr/target/site/jacoco/jacoco.csv monobank4j-json/target/site/jacoco/jacoco.csv monobank4j-token/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 monobank4j-gson/target/site/jacoco/jacoco.xml -r monobank4j-jackson/target/site/jacoco/jacoco.xml -r monobank4j-jackson-jr/target/site/jacoco/jacoco.xml -r monobank4j-json/target/site/jacoco/jacoco.xml -r monobank4j-token/target/site/jacoco/jacoco.xml
rules:
- if: $CODACY_PROJECT_TOKEN && $CI_COMMIT_TAG == null
release:
stage: deploy
script:
- mvn $MAVEN_CLI_OPTS -s ci_settings.xml clean deploy -Dchangelist= -ntp -Psources,javadocs -DaltDeploymentRepository=gitlab-maven::default::${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/packages/maven
only:
- tags