-
Notifications
You must be signed in to change notification settings - Fork 16
/
.gitlab-ci.yml
174 lines (174 loc) · 4.31 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
169
170
171
172
173
174
image: $CI_REGISTRY/vu/opencsd/opencsd:$CI_COMMIT_SHORT_SHA
stages:
- image
- static-analysis
- build
- test
- coverage
- memory
variables:
GIT_SUBMODULE_STRATEGY: normal
CODECOV_TOKEN: '35147f6b-a8db-4845-87f5-843334c2b4cf'
cache:
paths:
# - "dependencies/*"
- "build/opencsd/bin/*"
- "build/opencsd/lib/*"
- "build/opencsd/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/opencsd/opencsd:$CI_COMMIT_SHORT_SHA -f Dockerfile .
- docker push $CI_REGISTRY/vu/opencsd/opencsd:$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 -DIS_DEPLOYED=on -DENABLE_DOCUMENTATION=on ..
- make all-documents
artifacts:
paths:
- "*/*.pdf"
build-source-documentation:
stage: build
script:
- cd $CI_PROJECT_DIR
- mkdir -p build
- cd build || exit
- cmake -DIS_DEPLOYED=on -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 -DIS_DEPLOYED=on -DENABLE_PLAYGROUND=off -DENABLE_DOCUMENTATION=off ..
- make
artifacts:
paths:
- "build/opencsd/*.so"
- "build/opencsd/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/opencsd/*.so"
# - "build/opencsd/opencsd"
build-playground:
stage: build
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DIS_DEPLOYED=on -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 -DIS_DEPLOYED=on -DENABLE_PLAYGROUND=off -DENABLE_DOCUMENTATION=off -DENABLE_TESTS=on ..
- make check
artifacts:
reports:
junit: $CI_PROJECT_DIR/build/tests/tests.xml
#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
coverage: '/.*lines\.*:.*([0-9][0-9]\.[0-9]\%)/'
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DIS_DEPLOYED=on -DENABLE_CODECOV=on -DENABLE_DOCUMENTATION=off ..
- make clean
- make check
- make opencsd_coverage
- bash <(curl -s https://codecov.io/bash) -f coverage.total.info || echo "Codecov did not collect coverage reports"
artifacts:
paths:
- build/coverage/*
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
memory-valgrind:
stage: memory
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DIS_DEPLOYED=on -DENABLE_PLAYGROUND=off -DENABLE_DOCUMENTATION=off -DENABLE_TESTS=on ..
- make tests
- 'for test in $(ls tests/test*); do DEBUGINFOD_URLS="https://debuginfod.archlinux.org" G_SLICE=always-malloc valgrind --leak-check=full "$test"; done'
memory-sanitizer:
stage: memory
tags:
- linux
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DIS_DEPLOYED=on -DENABLE_LEAK_TESTS=on ..
- make check