-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
108 lines (95 loc) · 2.63 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
###########################
# DO NOT MODIFY THIS FILE #
# #########################
# We will use the same workflow as this file to test your submission.
#
# To customize this file, use file /.gitlab-ci-custom.yml
# docker image
image: ethsrilab/rse-project:1.3
# variables to be set in the build environment
variables:
# --batch-mode: Run in non-interactive (batch) mode
MVN_FLAGS: --batch-mode
stages:
- build
- unit-tests
- integration-tests
- deploy
cache: # cache compilation output between jobs
key: ${CI_COMMIT_REF_SLUG}
paths:
# cache maven directory
- /root/.m2
###############
# COMPILATION #
###############
limit-memory:
stage: build
script:
# limits the memory to be used on gitlab (workaround for a bug in case of
# not enough memory)
- cp analysis/settings_template.xml /root/.m2/settings.xml
compile-analysis:
stage: build
script:
# operate in the analysis directory
- cd analysis
# clean
- mvn $MVN_FLAGS clean
# compile the java code running the analysis
- mvn $MVN_FLAGS compile
artifacts:
paths:
- analysis/target
###########
# TESTING #
###########
unit-tests:
stage: unit-tests
script:
# operate in the analysis directory
- cd analysis
# run unit tests
- mvn $MVN_FLAGS test surefire-report:report
artifacts:
paths:
- analysis/target
reports:
junit:
- analysis/target/surefire-reports/TEST-*.xml
integration-tests:
stage: integration-tests
coverage: '/\d+.\d+ \% covered/'
script:
# operate in the analysis directory
- cd analysis
# run integration tests (timeout to reduce load on GitLab)
- timeout --signal=9 15m mvn $MVN_FLAGS verify -Dskip.surefire.tests
# style report site
- mvn $MVN_FLAGS site -Dskip.surefire.tests
# report test coverage to console
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' target/site/jacoco-merged-test-coverage-report/jacoco.csv
artifacts:
paths:
- analysis/target
reports:
junit:
- analysis/target/failsafe-reports/TEST-*.xml
run-analysis:
stage: integration-tests
script:
# operate in the analysis directory
- cd analysis
# compile tests (to have at least one binary to check)
- mvn $MVN_FLAGS clean test-compile
# run the verifier
- ./run.sh ch.ethz.rse.integration.tests.Basic_Test_Safe NON_NEGATIVE
artifacts:
paths:
- analysis/target
##################
# CUSTOMIZATIONS #
##################
include:
# customize this CI/CD configuration
- '/.gitlab-ci-custom.yml'