-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
80 lines (70 loc) · 1.56 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
image: volodyalarin/tp_cpp_course_env:ubuntu
variables:
COVER_LOG: cover.log
PROG: voyager
UNIT: gtest
LINTER: linter.sh
VALGRIND_LOG: valgrind.log
NO_LOST_PATTERN: "All heap blocks were freed -- no leaks are possible"
NO_ERROR_PATTERN: "ERROR SUMMARY: 0 errors"
stages:
- test_style
- build
- test
- docs
test_style:
stage: test_style
script:
- sh ./${LINTER}
needs: [ ]
build:
stage: build
script:
- git submodule init
- git submodule update
- cmake -B ./build
- make -C ./build
needs: [ ]
artifacts:
paths:
- ./build
- ./cmake-modules
expire_in: 15 minutes
unit_tests:
stage: test
script:
- cd build && ./${UNIT}
needs: [ "build" ]
coverage:
stage: test
script:
- cd build && cmake -DCMAKE_BUILD_TYPE=Debug ..
- make coverage > ${COVER_LOG}
- cat ${COVER_LOG}
artifacts:
paths:
- ./build/${COVER_LOG}
- ./build/coverage
needs: [ "build" ]
memory:
stage: test
script:
- valgrind --tool=memcheck --leak-check=full --track-origins=yes --log-file=${VALGRIND_LOG} ./build/${UNIT}
- export NO_LOST=$(grep "${NO_LOST_PATTERN}" ${VALGRIND_LOG})
- export NO_ERROR=$(grep "${NO_ERROR_PATTERN}" ${VALGRIND_LOG})
- if [ -z "${NO_LOST}" ] || [ -z "${NO_ERROR}" ]; then cat ${VALGRIND_LOG}; exit 1; fi
artifacts:
paths:
- ${VALGRIND_LOG}
needs: [ "build" ]
pages:
stage: docs
script:
- git submodule init
- git submodule update
- doxygen Doxyfile
- mv docs/html/ public/
artifacts:
paths:
- public
needs: []