forked from Dantali0n/OpenCSD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
168 lines (168 loc) · 3.81 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
image: $CI_REGISTRY/vu/qemu-csd/qemu-csd:$CI_COMMIT_SHORT_SHA
stages:
- image
- static-analysis
- build
- test
- coverage
- memory
variables:
GIT_SUBMODULE_STRATEGY: normal
cache:
paths:
# - "dependencies/*"
- "build/qemu-csd/arch-qemucsd.qcow2"
- "build/qemu-csd/bin/*"
- "build/qemu-csd/lib/*"
- "build/qemu-csd/include/*"
# before_script:
# - git submodule update --init
build-image:
stage: image
tags:
- dind
image: docker
services:
- name: docker:dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- cd scripts # Minimize build context migrated to docker container
- docker build -t $CI_REGISTRY/vu/qemu-csd/qemu-csd:$CI_COMMIT_SHORT_SHA -f Dockerfile .
- docker push $CI_REGISTRY/vu/qemu-csd/qemu-csd:$CI_COMMIT_SHORT_SHA
shellcheck-linting:
stage: static-analysis
tags:
- linux
before_script:
- pacman -Syy
- sudo pacman -Sy --noconfirm shellcheck
script:
- shellcheck scripts/*.sh
- shellcheck scripts/activate
build-documentation:
stage: build
tags:
- linux
script:
- cd $CI_PROJECT_DIR
- mkdir -p build
- cd build || exit
- cmake -DENABLE_DOCUMENTATION=on ..
- make latex-pdf
artifacts:
paths:
- "*/*.pdf"
build-source-documentation:
stage: build
script:
- cd $CI_PROJECT_DIR
- mkdir -p build
- cd build || exit
- cmake -DENABLE_DOCUMENTATION=on ..
- make doxygen
artifacts:
paths:
- "docs/*"
build-binaries:
stage: build
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DENABLE_PLAYGROUND=off -DENABLE_DOCUMENTATION=off ..
- make
artifacts:
paths:
- "build/qemu-csd/*.so"
- "build/qemu-csd/qemucsd"
# build-binaries-windows:
# stage: build
# tags:
# - windows
# script:
# - mkdir -p build
# - cd build || exit
# - cmake -G "Visual Studio 16 2019" -ENABLE_PLAYGROUND=on -DENABLE_DOXYGEN=off ..
# - ls -lah
# - cmake --build . --target ALL_BUILD
# artifacts:
# paths:
# - "build/qemu-csd/*.so"
# - "build/qemu-csd/qemucsd"
build-playground:
stage: build
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DENABLE_PLAYGROUND=on -DENABLE_DOCUMENTATION=off ..
- make playground
artifacts:
paths:
- "build/playground/play-*"
test:
stage: test
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DENABLE_PLAYGROUND=off -DENABLE_DOCUMENTATION=off -DENABLE_TESTS=on ..
- make check
#test-windows:
# stage: test
# tags:
# - windows
# script:
# - cd $CI_PROJECT_DIR || exit
# - mkdir -p build
# - cd build || exit
# - cmake -G "Visual Studio 16 2019" -DENABLE_PLAYGROUND=off -DENABLE_DOXYGEN=off -DENABLE_TESTS=on ..
# - make check
coverage:
stage: coverage
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DENABLE_CODECOV=on ..
- make clean
- make check
- make qemu-csd_coverage
artifacts:
paths:
- build/qemucsd_arguments/*
reports:
cobertura: build/coverage.xml
memory-valgrind:
stage: memory
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DENABLE_PLAYGROUND=off -DENABLE_DOCUMENTATION=off -DENABLE_TESTS=on ..
- make tests
- valgrind --leak-check=full tests/testcpp17
- valgrind --leak-check=full tests/testarguments
memory-sanitizer:
stage: memory
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DENABLE_LEAK_TESTS=on ..
- make check