forked from KDE/kstars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
165 lines (154 loc) · 5.38 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
# 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'
stages:
- build
- test
#- test-unstable
- deploy
- publish
include:
- project: sysadmin/ci-utilities
file:
- /gitlab-templates/linux.yml
- /gitlab-templates/windows.yml
- /gitlab-templates/android.yml
- /gitlab-templates/craft-appimage.yml
- /gitlab-templates/craft-windows-x86-64.yml
- /gitlab-templates/craft-macos-x86-64.yml
- /gitlab-templates/craft-windows-appx-qt5.yml
# - /gitlab-templates/reuse-lint.yml
# - /gitlab-templates/flatpak.yml
# Android CI is not ready yet
android_qt515:
rules:
- when: manual
allow_failure: true
# Craft recipes run as nightly on master
craft_appimage_qt515_x86_64:
needs:
- suse_tumbleweed_qt515
- build-and-test-stable
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: manual
allow_failure: true
craft_windows_qt515_x86_64:
needs:
- windows_qt515
- build-and-test-stable
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: manual
allow_failure: true
craft_macos_x86_64:
needs:
- build-and-test-stable
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
allow_failure: true # MacOS build is unstable
when: always
- when: manual
allow_failure: true
# Publishing to Windows store is being discussed
microsoftstore_qt515:
rules:
- when: manual
allow_failure: true
# This is the custom build we use until tests are operational in the KDE CI image
.custom_build:
interruptible: true
image: tallfurryman/kstars-ci:0.12
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:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- allow_failure: true
when: manual
before_script:
- du -hs "${CCACHE_DIR}" || mkdir -p "${CCACHE_DIR}"
- 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
after_script:
- ccache -s
# Run the build and keep the ccache folder as a fail-fast
build:
stage: build
extends: .custom_build
script:
- cd kstars-build
- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCCACHE_SUPPORT=ON -DBUILD_TESTING=OFF -DBUILD_DOC=OFF ..
- 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
needs:
- build
timeout: 3 hours
variables:
BUILD_TESTING: "ON"
script:
- cd kstars-build
- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCCACHE_SUPPORT=ON -DBUILD_TESTING=ON -DBUILD_DOC=ON ..
- 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
# 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
#