forked from KeYProject/key
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
119 lines (107 loc) · 2.5 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# This files describes the workflow of the continous integration
# checker for KeY run within gitlab.
#
# Jenkins runs are triggered from somewhere else.
#
image: wadoon/key-test-docker:jdk17
cache:
policy: pull-push
paths:
- .gradle/wrapper
- .gradle/caches
untracked: true
key: ${CI_COMMIT_REF_SLUG}
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 -Dorg.gradle.configureondemand=true"
GIT_DEPTH: 0
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
- export GRADLE_USER_HOME=`pwd`/.gradle
- export SONAR_SCANNER_OPTS="-Xmx8G"
stages:
- primary
- secondary
- ternary
- deploy
compile:classes:
stage: primary
image: wadoon/key-test-docker:jdk11
script:
- javac -version
- gradle --build-cache classes
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- .gradle
compile:testClasses:
dependencies: ["compile:classes"]
stage: secondary
image: wadoon/key-test-docker:jdk17
script:
- javac -version
- gradle --build-cache --parallel testClasses
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull-push
paths:
- build
- .gradle
sonarqube:
dependencies: ["compile:testClasses"]
stage: ternary
image: wadoon/key-test-docker:jdk17
allow_failure: true
script:
- ./scripts/tools/sonarqube_hint.py
- gradle --build-cache --continue -Dsonar.qualitygate.wait=true -DjacocoEnabled=true testFast sonarqube
only:
- merge_requests
- master
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle
artifacts:
reports:
junit:
- "**/**/build/test-results/*/TEST-*.xml"
format:
stage: primary
image: wadoon/key-test-docker:jdk17
allow_failure: true
script:
- gradle spotlessCheck
checkstyle:
stage: primary
image: wadoon/key-test-docker:jdk11
allow_failure: true
script:
- (scripts/tools/checkstyle/runIncrementalCheckstyle.sh | tee report.txt) || true
- scripts/tools/checkstyle/translateAudit.py report.txt > report.json
artifacts:
name: "checkstyle-report-$CI_JOB_ID"
paths:
- report.txt
when: always
reports:
codequality: report.json
expire_in: 1 year
deploy-nightly:
stage: deploy
script:
- BUILD_NUMBER=SNAPSHOT gradle publish
only:
- stable
deploy-release:
when: manual
stage: deploy
script:
- gradle publish
only:
- /^KeY-.*$/