forked from KDE/kstars
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
315 lines (287 loc) · 11.7 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
315 lines (287 loc) · 11.7 KB
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# This YAML recipe builds KStars with INDI support, then runs all tests
# It uses both KDE CI and custom image until tests are stabilised in the KDE CI image
# Build dependencies for the custom image are packaged into image definition 'docker/Dockerfile'
include:
- local: ".gitlab-ci/common_rules.yml"
- project: sysadmin/ci-utilities
file:
- /gitlab-templates/linux.yml
- /gitlab-templates/linux-qt6.yml
- /gitlab-templates/windows-qt6.yml
- /gitlab-templates/flatpak.yml
- /gitlab-templates/flatpak-arm64.yml
- /gitlab-templates/craft-windows-x86-64-qt6.yml
- /gitlab-templates/craft-windows-appx-qt6.yml
- /gitlab-templates/craft-macos-x86-64-qt6.yml
- /gitlab-templates/craft-macos-arm64-qt6.yml
# Jobs
# Standard build recipes
.standard-build-recipes:
rules:
- !reference [.optional-on-forked-repository, rules]
- !reference [.optional-on-draft-merge-requests, rules]
- !reference [.optional-on-scheduled-pipeline, rules]
- !reference [.always-on-master-branch, rules]
- !reference [.always-on-merge-requests, rules]
- !reference [.manual-skipped-recipe, rules]
# Override the script for Suse Tumbleweed to avoid building with tests,
# since ci-utilities/run-ci-build.py turns it on
suse_tumbleweed_qt610:
allow_failure: true # Necessary since INDI interface changed
script:
- git config --global --add safe.directory $CI_PROJECT_DIR
- >-
python3 -u ci-utilities/run-ci-build.py --project $CI_PROJECT_NAME
--branch $CI_COMMIT_REF_NAME --platform Linux/Qt6/Shared
--extra-cmake-args=-DBUILD_WITH_QT6=ON
--extra-cmake-args=-DQT_MAJOR_VERSION=6
--extra-cmake-args=-DBUILD_TESTING=OFF
- |
if [ -d "$INSTALLED_DOC_PATH" ]; then
git clone https://invent.kde.org/websites/docs-kde-org.git --depth=1
python3 ci-utilities/generate-documentation.py --project $CI_PROJECT_NAME --output-folder "generated_documentation" --format html pdf --branch $CI_COMMIT_REF_NAME --publish --doc-dir $INSTALLED_DOC_PATH
fi
rules:
- !reference [.always-on-scheduled-pipeline, rules] # Flatpak nightly
- !reference [.standard-build-recipes, rules]
# These jobs are automatically defined by the included templates
# We just need to override their rules - no need to extend anything
windows_qt610:
allow_failure: true # TODO: REMOVE WHEN STELLARSOLVER QT6 IS INCLUDED IN CI IMAGE
rules:
- !reference [.standard-build-recipes, rules]
needs:
- suse_tumbleweed_qt610 # Wait for a success of the fast job
suse_tumbleweed_qt515:
variables:
HOME: /tmp
STELLARSOLVER_PREFIX: "$CI_PROJECT_DIR/.local/stellarsolver"
CMAKE_PREFIX_PATH: "$CI_PROJECT_DIR/.local/stellarsolver:$CMAKE_PREFIX_PATH"
LD_LIBRARY_PATH: "$CI_PROJECT_DIR/.local/stellarsolver/lib64:$CI_PROJECT_DIR/.local/stellarsolver/lib:$LD_LIBRARY_PATH"
PKG_CONFIG_PATH: "$CI_PROJECT_DIR/.local/stellarsolver/lib64/pkgconfig:$CI_PROJECT_DIR/.local/stellarsolver/lib/pkgconfig:$PKG_CONFIG_PATH"
rules:
# - !reference [.standard-build-recipes, rules]
- when: never # DISABLED, since tumbleweed has problems with Qt5
before_script:
- git clone https://invent.kde.org/sysadmin/ci-utilities.git --depth=1
- git clone https://invent.kde.org/sysadmin/repo-metadata.git ci-utilities/repo-metadata/ --depth=1
# Build-Dependencies für StellarSolver (Qt5 Job; Qt/KF5 sind im Basis-Image bereits vorhanden)
- zypper -n ref
- >-
zypper -n in --no-recommends
libeigen3-devel
cfitsio-devel
zlib-ng-devel
gettext
libnova-devel
gsl-devel
libraw-devel
wcslib-devel
xplanet
libsecret-1-0
kinit-devel
kf6-breeze-icons
# build and install StellarSolver locally
- mkdir -p "$STELLARSOLVER_PREFIX"
- rm -rf stellarsolver
- git clone https://github.com/rlancaste/stellarsolver.git --depth=1 stellarsolver
- >-
cmake -S stellarsolver -B stellarsolver/build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX="$STELLARSOLVER_PREFIX"
- cmake --build stellarsolver/build -j"$(nproc)"
- cmake --install stellarsolver/build
script:
- git config --global --add safe.directory $CI_PROJECT_DIR
- >-
python3 -u ci-utilities/run-ci-build.py --project $CI_PROJECT_NAME
--branch $CI_COMMIT_REF_NAME --platform Linux/Qt5/Shared
--extra-cmake-args=-DBUILD_WITH_QT6=OFF
--extra-cmake-args=-DQT_MAJOR_VERSION=5
--extra-cmake-args=-DBUILD_TESTING=OFF
- |
if [ -d "$INSTALLED_DOC_PATH" ]; then
git clone https://invent.kde.org/websites/docs-kde-org.git --depth=1
python3 ci-utilities/generate-documentation.py --project $CI_PROJECT_NAME --output-folder "generated_documentation" --format html pdf --branch $CI_COMMIT_REF_NAME --publish --doc-dir $INSTALLED_DOC_PATH
fi
json-validation:
stage: validate
rules:
- !reference [.standard-build-recipes, rules]
astyle-check:
stage: validate
image: ubuntu:24.04
rules:
- !reference [.standard-build-recipes, rules]
script:
- apt-get update && apt-get install -y --no-install-recommends git python3-pip
- |
ASTYLE_VERSION="$(cat .astyle-version)"
python3 -m pip install --break-system-packages "astyle==${ASTYLE_VERSION}"
astyle --version
astyle --version | grep -q "Version ${ASTYLE_VERSION}" || {
echo "ERROR: CI astyle version mismatch (expected ${ASTYLE_VERSION})." >&2
exit 1
}
- |
if [ -n "${CI_MERGE_REQUEST_DIFF_BASE_SHA:-}" ]; then
bash tools/run_astyle.sh --check --changed-since "${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
elif [ -n "${CI_COMMIT_BEFORE_SHA:-}" ] && [ "${CI_COMMIT_BEFORE_SHA}" != "0000000000000000000000000000000000000000" ]; then
bash tools/run_astyle.sh --check --changed-since "${CI_COMMIT_BEFORE_SHA}"
else
bash tools/run_astyle.sh --check
fi
# Craft recipes
.craft-recipes:
rules:
- !reference [.optional-on-forked-repository, rules]
- !reference [.optional-on-draft-merge-requests, rules]
- !reference [.optional-on-scheduled-pipeline, rules]
- !reference [.always-on-master-branch, rules]
- !reference [.always-on-stable-release, rules]
- !reference [.manual-skipped-recipe, rules]
# These craft jobs are also automatically defined by the included templates
craft_windows_qt6_x86_64: # Extended from /gitlab-templates/craft-windows-x86-64-qt6.yml
needs:
- windows_qt610
rules:
- !reference [.craft-recipes, rules]
craft_macos_qt6_x86_64: # Extended from /gitlab-templates/craft-macos-x86-64-qt6.yml
timeout: 2h # Signing procedure often exceeds the default 1h
needs:
- suse_tumbleweed_qt610 # we don't have a macos check build
rules:
- !reference [.craft-recipes, rules]
craft_macos_qt6_arm64: # Extended from /gitlab-templates/craft-macos-arm64-qt6.yml
timeout: 2h # Signing procedure often exceeds the default 1h
needs:
- suse_tumbleweed_qt610 # we don't have a macos check build
rules:
- !reference [.craft-recipes, rules]
# Publishing recipes
.publishing-recipes:
rules:
- !reference [.always-on-stable-release, rules]
- !reference [.manual-skipped-recipe, rules]
- when: never
microsoftstore_qt6:
needs:
- craft_windows_qt6_x86_64 # Wait for Windows craft job to complete
rules:
- !reference [.publishing-recipes, rules]
flatpak-amd64:
timeout: 2h
needs:
- suse_tumbleweed_qt610
rules:
- !reference [.always-on-scheduled-pipeline, rules]
- !reference [.publishing-recipes, rules]
flatpak-arm64:
timeout: 2h
needs:
- suse_tumbleweed_qt610
rules:
- !reference [.always-on-scheduled-pipeline, rules]
- !reference [.publishing-recipes, rules]
# Custom build recipes - until tests are operational in the KDE CI image
.custom-build-recipes:
rules:
- !reference [.optional-on-forked-repository, rules]
- !reference [.optional-on-draft-merge-requests, rules]
- !reference [.always-on-merge-requests, rules]
- !reference [.manual-skipped-recipe, rules]
.custom_build:
interruptible: true
variables:
CCACHE_BASEDIR: "$CI_PROJECT_DIR"
QT_TEST_TIMEOUT_FUNCTION: "600"
QT_QPA_PLATFORM: "eglfs"
CCACHE_DIR: "$CI_PROJECT_DIR/.ccache"
cache:
key: "CCACHE-DB-$CI_PROJECT_ID"
paths: ["${CCACHE_DIR}"]
when: always
rules:
- !reference [.custom-build-recipes, rules]
before_script:
- du -hs "${CCACHE_DIR}" || mkdir -p "${CCACHE_DIR}"
- |
# Ubuntu interim releases move off the primary mirrors after EOL.
if [ -r /etc/os-release ]; then
. /etc/os-release
if [ "${ID:-}" = "ubuntu" ] && [ "${VERSION_CODENAME:-}" = "oracular" ]; then
find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) -print0 | \
xargs -0 sed -i \
-e 's|http://archive.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' \
-e 's|http://security.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' \
-e 's|http://ports.ubuntu.com/ubuntu-ports|http://old-releases.ubuntu.com/ubuntu|g'
fi
fi
- add-apt-repository --remove ppa:mutlaqja/ppa
- add-apt-repository ppa:mutlaqja/ppa
- apt update
- apt -y --no-install-recommends install libindi1 libindi-dev libindi-data indi-bin xplanet gsc phd2 libstellarsolver libstellarsolver-dev libcurl4-openssl-dev
- mkdir -p kstars-build
after_script:
- ccache -s
# Run the build and keep the ccache folder as a fail-fast
ubuntu_qt5:
stage: build
extends: .custom_build
image:
name: sternejaeger/kstars-ci:qt5
allow_failure: true # TODO: REMOVE IF TIMEOUT PROBLEMS ARE FIXED
needs:
- suse_tumbleweed_qt610
script:
- cd kstars-build
- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCCACHE_SUPPORT=ON -DBUILD_TESTING=OFF -DBUILD_DOC=OFF -DBUILD_WITH_QT6=OFF ..
- ninja -j8 all install
ubuntu_qt6:
stage: build
extends: .custom_build
image:
name: sternejaeger/kstars-ci:qt6
allow_failure: true # TODO: REMOVE WHEN STABLE AGAIN
needs:
- suse_tumbleweed_qt610
rules:
- when: never # DISABLED, since we use tumbleweed_qt6 for Qt6 compile checks
script:
- cd kstars-build
- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCCACHE_SUPPORT=OFF -DBUILD_TESTING=OFF -DBUILD_DOC=OFF -DBUILD_WITH_QT6=ON ..
- ninja -j8 all install
# Run the full validation in one step, stable tests that must not fail
# The artifacts take far too much time to propagate from one step to the other
# The cache is unreliable, and only works on the same runner if there is no shared cache - use it for ccache instead
# Consolidate runner with build packages and build
build-and-test-stable:
stage: test
extends: .custom_build
image:
name: sternejaeger/kstars-ci:qt5
allow_failure: true # TODO: REMOVE WHEN STABLE AGAIN
needs:
- ubuntu_qt5
timeout: 3 hours
variables:
BUILD_TESTING: "ON"
script:
- cd kstars-build
- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCCACHE_SUPPORT=ON -DBUILD_TESTING=ON -DBUILD_WITH_QT6=OFF ..
- ninja -j8 all install
- rm -rf Testing
- mkdir -p /var/run/dbus
- dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address
- dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
- apt install -y --no-install-recommends dbus-x11
- export $(dbus-launch)
- dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
- xvfb-run ctest -T test -L stable -LE unstable --output-on-failure
after_script:
- pwd
- saxon-xslt -u $(find . -name Test.xml) https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl > ./junit_result.stable.xml
- ccache -s
artifacts:
reports:
junit: ./junit_result.stable.xml