-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
81 lines (68 loc) · 1.96 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
stages:
- build
- checkstyle
- test
image: gradle:7.3.3-jdk17-alpine
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
buildServer:
stage: build
script:
- ./gradlew :server:build -x checkStyleMain -x compileTestJava -x processTestResources -x testClasses -x checkstyleTest -x check
buildCommons:
stage: build
script:
- ./gradlew :commons:compileJava
buildClient:
stage: build
script:
- ./gradlew :client:build -x checkStyleMain -x compileTestJava -x processTestResources -x testClasses -x checkstyleTest -x check
testCheckStyleCommons:
stage: checkstyle
needs:
- buildCommons
dependencies:
- buildCommons
script:
- ./gradlew :commons:checkStyleMain -x compileJava -x classes -x processResources -x jar
testCheckStyleServer:
stage: checkstyle
needs:
- buildServer
dependencies:
- buildServer
script:
- ./gradlew :server:checkStyleMain -x compileJava -x classes -x processResources -x jar
testCheckStyleClient:
stage: checkstyle
needs:
- buildClient
dependencies:
- buildClient
script:
- ./gradlew :client:checkStyleMain -x compileJava -x classes -x processResources -x jar
testAndCoverage:
stage: test
needs:
- buildCommons
dependencies:
- buildCommons
script:
- ./gradlew test
- ./gradlew AggregateJacocoReport
# preserve coverage information in an easy-to-reach folder
- mv build/reports/jacoco/aggregate/html ./coverage
- mv build/reports/jacoco/aggregate/jacocoTestReport.xml ./coverage/report.xml
- echo `cat coverage/index.html | grep -o -E "Total[^%]+?%" | sed -E "s/<.*>//" | sed -E "s/Total/TestCoverage:/"`
artifacts:
name: "Test reports from $CI_PROJECT_NAME:$CI_COMMIT_REF_SLUG"
when: always
paths:
- "*/build/test-results/test/TEST-*.xml"
- "./coverage"
reports:
junit:
- "*/build/test-results/test/TEST-*.xml"
coverage: /TestCoverage:(\d+)%/