blob: 4ada1300607650fae795d54db0299b2cab2d2a0e (
plain)
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
# Dependencies are managed in the Dockerfile in the inkscape-ci-docker
# Git repository. Change them there, wait a bit, and then we'll use
# the new ones here in these builds.
image: registry.gitlab.com/inkscape/inkscape-ci-docker/master
variables:
GIT_DEPTH: "10"
GIT_SUBMODULE_STRATEGY: recursive
#######################
# #
# Building inkscape #
# #
#######################
# Linux, Appimage, mac. Windows is handled in .appveyor.yml
### On linux...
inkscape:linux:
stage: build
except:
- schedules
cache:
key: "cache-linux"
paths:
- ccache/
before_script:
# CCache Config
- mkdir -p ccache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
script:
- mkdir -p build/conf
- ln -s . share/inkscape
- cd build
- cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$PWD/install_dir/ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- make -j3 install
- make -j3 tests
- cpack -G DEB
- rm -rf src _CPack_Packages # exclude from artifacts
- cd ..
artifacts:
expire_in: 1 year
paths:
- build/
### + Appimage (custom script, cf generate.sh)
appimage:linux:
stage: build
except:
- schedules
cache:
key: "cache-appimage"
paths:
- ccache/
before_script:
# CCache Config
- mkdir -p ccache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
script:
- bash -ex packaging/appimage/generate.sh
artifacts:
expire_in: 1 year
paths:
- Inkscape*.AppImage*
### On mac... (this needs a custom mac runner)
inkscape:mac:
stage: build
tags:
- mac
only:
- branches@inkscape/inkscape
- branches@dehesselle/inkscape
except:
- schedules
before_script:
- packaging/macos/build_toolset.sh
script:
- packaging/macos/build_inkscape.sh
artifacts:
expire_in: 1 year
paths:
- artifacts/
allow_failure: true
###########################
# #
# Various code checkers #
# #
###########################
### This script checks for *merge requests* that they conform to the code style. It allows failures.
# cf ./_clang-format and https://inkscape.org/develop/coding-style/
codequality:
stage: build
except:
- schedules
script:
- git fetch https://gitlab.com/inkscape/inkscape.git
- echo "Your commit does not comply exactly with the clang-format style checker.\nPlease review the following diff or apply it with\n \$ git apply <<EOF"
- git diff FETCH_HEAD -U0 --no-color | clang-format-diff-6.0 -p1 -style file | tee clang_format_diff
- echo "EOF"
- if [[ -s clang_format_diff ]]; then false; fi
allow_failure: true
### We embed script from third party libraries, that we sometimes update from their source. Hence we should NEVER modify them here before submitting the patch upstream!
# Ideally, we should remove all this code and use them as packaged libraries. Unfortunately this check only works for merge requests.
codeprotect:
stage: build
except:
- schedules
script:
- git fetch https://gitlab.com/inkscape/inkscape.git
- git diff FETCH_HEAD -U0 --no-color src/2geom/ src/3rdparty/adaptagrams/ src/3rdparty/libdepixelize src/3rdparty/libuemf | tee forbidden
- if [[ -s forbidden ]]; then echo "This commit modifies files that are in an dependency library. Make sure you update upstream first, *then* force the merge in Inkscape."; false; fi
#### All files should have a licence
check-license-headers:
stage: build
except:
- schedules
script:
- python buildtools/check_license_headers.py
### Several translation tests:
# - verify that the list of translatable files (POTFILES.*.in) are up to date
# - check if we can successfully re-generate inkscape.pot
# - sync all .po files with the updated inkscape.pot and run some automated checks on them
# (artifacts from this job are also used to generate translations statistics for the website)
translations:
stage: build
except:
- schedules
script:
# make sure dependencies for inkscape.pot are up-to-date
- mkdir build && cd build && cmake .. && make inkscape_pot && cd .. || exit 1
- cd po/
# update POTFILES.*.in
- ./generate_POTFILES.sh
# update inkscape.pot and sync all .po files
- rm -f inkscape.pot
- cd ../build && make inkscape_pot && cd ../po || exit 1
- ./update_po_files.sh
# check if POTFILES.*.in should be updated in the repo (shall we automate this?)
- 'if [ -n "$(git diff POTFILES.*.in)" ]; then
git diff POTFILES.*.in;
echo "New translatable strings in source files found.";
echo "Please add the paths to POTFILES.*.in so they can be translated";
echo "(or add them to POTFILES.skip to exclude them from translations).";
exit 1;
fi'
artifacts:
name: "translations"
paths:
- po/
when: always
### clang-tidy is an utility to check that some c++ code good practices and patterns are respected. We use it at 1% of its possibilities (only when it suggests fixes).
clangtidy:linux:
stage: build
except:
- schedules
- branches@inkscape/inkscape
script:
- git fetch https://gitlab.com/inkscape/inkscape.git
# "borrow" a 2geom file to dump header includes
- git diff FETCH_HEAD --name-only | (grep '^src/.*\.h$' || true) | sed 's/^src/#include"../;s/$/"/' | tee src/2geom/geom.cpp
- git diff FETCH_HEAD --name-only | grep '^src/.*\.cpp$' | tee clang_tidy_files
- bash buildtools/clangtidy-helper.sh $(cat clang_tidy_files)
clangtidyfull:linux:
stage: build
except:
- schedules
only:
- branches@inkscape/inkscape
script:
- bash buildtools/clangtidy-helper.sh
### scan-build is a static analysis tool. This job is *slow*.
clang:
stage: build
only:
variables:
- $SCHEDULED_JOB_NAME == "clang"
script:
- apt-get update -yqq && apt-get install -y clang
- mkdir -p clang-build
- cd clang-build
- scan-build cmake .. -DCMAKE_BUILD_TYPE=Debug
- VERBOSE=1 scan-build -o ../scan make -j2
artifacts:
paths:
- scan/
### doxygen
source-doc:
stage: build
only:
variables:
- $SCHEDULED_JOB_NAME == "source-doc"
script:
- cd buildtools
- doxygen Doxyfile
- doxygen Doxyfile-extensions
- cd ..
artifacts:
paths:
- doc/doxygen
- doc/doxygen-extensions
################
# #
# Unit tests #
# #
################
test:linux:
stage: test
except:
- schedules
dependencies:
- inkscape:linux
script:
- cd build
- ctest -V
artifacts:
paths:
- build/testfiles
when: always
# uploads the clang scan to user.gitlab.io/inkscape/
pages:
stage: deploy
cache:
key: "cache-pages"
paths:
- public
only:
- schedules
dependencies:
- source-doc
- clang
script:
- mkdir -p public/
- sed "s/%DATE%/$(date '+%B %d, %Y')/" buildtools/ci-index.html > public/index.html
- if test -e scan; then rm -fr public/scan-build && cp -rv scan/* public/scan-build; fi
- if test -e doc/doxygen; then cp -rv doc/doxygen/html public/doxygen; fi
- if test -e doc/doxygen-extensions; then cp -rv doc/doxygen-extensions/html public/doxygen-extensions; fi
artifacts:
paths:
- public
|