forked from KDE/kstars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
134 lines (124 loc) · 4.85 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
# This YAML recipe builds KStars with INDI support, then runs all tests
# Build dependencies are in packaged into image definition 'docker/Dockerfile'
# As of 202009, two-stage pipeline fails on propagation of artifact from stage build to stage test
# Probably because the upload uses a webdav REST API, and there are many large files in the list
stages:
- build
- test
#- test-unstable
image: tallfurryman/kstars-ci:0.12
variables:
CCACHE_BASEDIR: "$CI_PROJECT_DIR"
QT_TEST_TIMEOUT_FUNCTION: "600"
QT_QPA_PLATFORM: "eglfs"
# In order to be cached successfully, the ccache folder must reside *inside* $CI_PROJECT_DIR
CCACHE_DIR: "$CI_PROJECT_DIR/.ccache"
# We cache the ccache folder
cache:
key: "CCACHE-DB-$CI_PROJECT_ID"
paths:
- "${CCACHE_DIR}"
# Unfortunately, cache:when is not available in the KDE version of gitlab
# Impact: we need a first build to succeed before the cache is available on the runner for further builds
# when:
# - always
.build_recipe: &build_recipe
- add-apt-repository --remove ppa:mutlaqja/indinightly
- 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
- mkdir -p kstars-build
- cd kstars-build
- cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. -DCCACHE_SUPPORT=ON -DBUILD_TESTING=${BUILD_TESTING:-OFF} -DBUILD_DOC=${BUILD_DOC:-OFF}
- ninja -j8 all install
build:
stage: build
interruptible: true
only:
- master
- merge_requests
before_script:
- du -hs "${CCACHE_DIR}" || mkdir -p "${CCACHE_DIR}"
script:
- *build_recipe
after_script:
- ccache -s
# 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
interruptible: true
only:
- merge_requests
variables:
BUILD_TESTING: "ON"
before_script:
- *build_recipe
script:
- 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
# Run the full validation in one step, unstable tests still in development
# build-and-test-unstable:
# stage: test-unstable
# interruptible: true
# allow_failure: true
# only:
# - merge_requests
# variables:
# BUILD_TESTING: "ON"
# before_script:
# - *build_recipe
# script:
# - 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 -LE stable --output-on-failure --no-compress-output
# 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.unstable.xml
# - ccache -s
# artifacts:
# reports:
# junit:
# ./junit_result.unstable.xml
# build-appimage:
# stage: test
# interruptible: true
# allow_failure: true
# only:
# - merge_requests
# before_script:
# - python3 -m pip install appimage-builder
# - wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /opt/appimagetool
# - chmod +x /opt/appimagetool
# - pushd /opt/; /opt/appimagetool --appimage-extract
# - mv /opt/squashfs-root /opt/appimagetool.AppDir
# - ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool
# - popd
# script:
# - *build_recipe
# - appimage-builder --recipe ../appimage/appimage-builder.yml --skip-test
# artifacts:
# expire_in: 1 week
# paths:
# - 'kstars-build/*.AppImage*'