-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
.gitlab-ci.yml
247 lines (224 loc) · 6.89 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
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
# SPDX-FileCopyrightText: © 2024 Alexandros Theodotou <alex@zrythm.org>
# SPDX-License-Identifier: LicenseRef-ZrythmLicense
workflow:
rules:
# run merge request pipelines
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# do not run branch pipelines if corresponding merge requests exist...
# (this avoids duplicate pipelines)
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
# ...but otherwise run branch pipelines
- if: $CI_COMMIT_BRANCH
# run tag pipelines
- if: $CI_COMMIT_TAG
variables:
COMMON_CMAKE_OPTIONS: >-
-DZRYTHM_STRICT=ON
-DZRYTHM_YAML_PROJECT_COMPATIBILITY=ON
-DZRYTHM_TESTS=ON
-DZRYTHM_BENCHMARKS=ON
stages:
- setup
- check
- build # also test/install
- deploy
.unix-activate-venv: &unix-activate-venv
- source ./venv/bin/activate
.windows-activate-venv: &windows-activate-venv
- ./venv/Scripts/Activate.ps1
# .mac-enable-brew-env: &mac-enable-brew-env
# - eval "$(/opt/homebrew/bin/brew shellenv)";
.windows-enable-vs-env: &windows-enable-vs-env
- Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
- >-
Enter-VsDevShell
-VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Community"
-SkipAutomaticLocation
-DevCmdArguments -arch=x64
#- chcp 65001 # UTF-8
.gnu-linux-template:
tags:
- archlinux
variables:
BUILDDIR: "build_gnu_linux"
before_script:
- *unix-activate-venv
artifacts:
paths:
- $BUILDDIR
expire_in: 3 days
.mac-arm-template:
tags:
- mac-arm
variables:
BUILDDIR: "build_mac_arm"
before_script:
- *unix-activate-venv
artifacts:
paths:
- $BUILDDIR
expire_in: 3 days
.windows-template:
tags:
- windows11
variables:
BUILDDIR: "build_windows"
INSTALLDIR: "install_windows"
BOOST_ROOT: "C:\\Boost\\boost_1_86_0"
VSLANG: "1033"
# use /MP1 to disable parallel builds if the compiler messages are hard to read
CL: "/MP" # prepended to the cl command
_CL_: "" # appended to the cl command
_LINK_: /verbose
before_script:
- *windows-enable-vs-env
- *windows-activate-venv
artifacts:
paths:
- $BUILDDIR
expire_in: 3 days
default:
cache:
# this number must be bumped every time these subprojects are updated
- key: cache-5-$CI_RUNNER_DESCRIPTION
paths:
- venv
- "$BUILDDIR/_deps/*-src"
configure:gnu/linux:
extends: .gnu-linux-template
stage: setup
before_script:
- python3 -m venv venv
- *unix-activate-venv
- python3 -m pip install -r requirements.txt
script:
- >-
cmake -B $BUILDDIR $COMMON_CMAKE_OPTIONS
-G "Ninja"
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_PREFIX_PATH=/opt/gtk-for-zrythm
configure:mac-arm:
extends: .mac-arm-template
stage: setup
before_script:
- python3 -m venv venv
- *unix-activate-venv
- python3 -m pip install -r requirements.txt
script:
- >-
cmake -B $BUILDDIR $COMMON_CMAKE_OPTIONS
-G "Xcode"
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
"-DCMAKE_PREFIX_PATH=/opt/zrythm-deps-installed;/Users/alex/gtk/inst"
configure:windows:
extends: .windows-template
stage: setup
before_script:
- *windows-enable-vs-env
- python -m venv venv
- *windows-activate-venv
- python -m pip install -r requirements.txt
script:
# TODO: enable strict flags & tests
- >-
cmake -B "${env:BUILDDIR}"
-DZRYTHM_STRICT=ON
-DZRYTHM_YAML_PROJECT_COMPATIBILITY=ON
-DZRYTHM_TESTS=OFF
-DZRYTHM_BENCHMARKS=OFF
-DZRYTHM_FFTW3_THREADS_SEPARATE=FALSE
"-DCMAKE_PREFIX_PATH=C:\zrythm-deps-installed;C:\gtk-plus;C:\lv2;C:\gtk-build\gtk\x64\release"
-G "Visual Studio 17 2022"
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL"
-DCMAKE_BUILD_TYPE=Debug
"-DCMAKE_INSTALL_PREFIX=${PWD}\${env:INSTALLDIR}"
-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
clang-format-check:
extends: .gnu-linux-template
stage: check
needs: []
script:
- python3 scripts/run_clang_format.py --dry-run
reuse-check:
extends: .gnu-linux-template
stage: check
needs: []
script:
- reuse lint
exif-check:
extends: .gnu-linux-template
stage: check
needs: []
script:
- scripts/exif_check.sh
.unix_test_cmd: &unix_test_cmd
- ctest --test-dir $BUILDDIR -V || (cat "$BUILDDIR/Testing/Temporary/LastTest.log" && exit 1)
build:gnu/linux:
extends: .gnu-linux-template
stage: build
script:
- cmake --build $BUILDDIR
- *unix_test_cmd
- ctest --test-dir $BUILDDIR -V --overwrite MemoryCheckCommand=valgrind --overwrite MemoryCheckCommandOptions="--undef-value-errors=no --exit-on-first-error=yes --error-exitcode=1" -T memcheck || (cat "$BUILDDIR/Testing/Temporary/MemoryChecker.*.log" && exit 1)
- >-
git diff -U0 HEAD^
| python3 /usr/share/clang/clang-tidy-diff.py -p1
-path ./builddir_cmake -config-file .clang-tidy
-use-color || true # ignore errors for now
build:mac-arm:
extends: .mac-arm-template
stage: build
script:
- cmake --build $BUILDDIR --config Debug
- *unix_test_cmd
build:windows:
extends: .windows-template
stage: build
script:
- cmake --build ${env:BUILDDIR} --config Debug --verbose
- ctest --test-dir ${env:BUILDDIR} -V; if (-not $?) { Get-Content ${env:BUILDDIR}/Testing/Temporary/LastTest.log; exit 1 }
update-manual:
stage: deploy
only:
- master
- tags
tags:
- archlinux
script:
- ninja -C $BUILDDIR manual_bundle &> manual_bundle_results.txt || (cat manual_bundle_results.txt && exit 1)
- rsync -av --no-group --omit-dir-times --exclude '*.zip' "$BUILDDIR"/doc/user/_rendered/* $REMOTE_CI_USER@www.zrythm.org:$REMOTE_USER_MANUAL_UPLOAD_PATH
before_script:
- eval $(ssh-agent -s)
#- ssh-add <(echo "$SSH_PRIVATE_KEY")
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- *unix-activate-venv
update-dev-docs:
stage: deploy
only:
- master
- tags
tags:
- archlinux
script:
- cmake --build $BUILDDIR --target doxygen-docs &> gen_dev_docs_results.txt || (cat gen_dev_docs_results.txt && exit 1)
- rsync -av --no-group --omit-dir-times "$BUILDDIR"/doc/dev/html/* $REMOTE_CI_USER@www.zrythm.org:$REMOTE_DEV_DOCS_UPLOAD_PATH
before_script:
- eval $(ssh-agent -s)
#- ssh-add <(echo "$SSH_PRIVATE_KEY")
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- *unix-activate-venv
variables:
GIT_SUBMODULE_STRATEGY: recursive