forked from TamasPetii/CityBuilder3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
93 lines (83 loc) · 1.9 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
image: ubuntu:20.04
variables:
game_path: 'CityBuilder/Game/'
game_cpp_files: '$game_path/*.cpp $game_path/GameFields/*.cpp $game_path/GameFields/Zones/*.cpp $game_path/GameFields/General/*.cpp $game_path/GameFields/Buildings/*.cpp'
stages:
- build
- test
- coverage
- analysis
- document
- deploy
before_script:
- apt-get update -yqq
- apt-get install -yqq build-essential
- apt-get install -yqq cppcheck
- apt-get install -yqq python3-pip
- pip install gcovr
build:
stage: build
script:
- g++ -c $game_cpp_files -W -Wall -Wextra
test:
stage: test
script:
- g++ -o test $game_cpp_files CityBuilder/Test/Test.cpp
- ./test
coverage:
stage: coverage
script:
- g++ -fprofile-arcs -ftest-coverage -o test $game_cpp_files CityBuilder/Test/Test.cpp
- ./test
- gcovr -r . --html-details -o coverage_report.html --exclude 'CityBuilder/Test/*'
- mkdir gcovr_coverage
- cp -r *.html *.css gcovr_coverage/
- mv gcovr_coverage/ public/
artifacts:
paths:
- public
expire_in: 1 day
only:
- develop
- master
analysis:
stage: analysis
script:
- cppcheck --enable=all --xml --xml-version=2 $game_cpp_files 2> cppcheck_report.xml
- cppcheck-htmlreport --file=cppcheck_report.xml --report-dir=cppcheck_analysis
- mv cppcheck_analysis/ public/
artifacts:
paths:
- public
expire_in: 1 day
only:
- develop
- master
document:
stage: document
before_script:
- apt-get update -yqq
- apt-get install -yqq doxygen graphviz
script:
- doxygen
- mkdir doxygen_documentation
- cp -r doc/html/. doxygen_documentation/
- mv doxygen_documentation/ public/
artifacts:
paths:
- public
expire_in: 1 day
only:
- develop
- master
pages:
stage: deploy
script:
- ls public/
artifacts:
paths:
- public
expire_in: 1 day
only:
- develop
- master