-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
.gitlab-ci.yml
117 lines (105 loc) · 3.07 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
# 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
stages:
- setup
- check
- build
- test
- deploy
- cleanup
default:
cache:
# this number must be bumped every time these subprojects are updated
- key: configured-cache-8
paths:
- venv
- subprojects/gtk4
- subprojects/libadwaita
- subprojects/libpanel
- subprojects/yyjson
- subprojects/libcyaml
- subprojects/libbacktrace
- key: "$CI_PIPELINE_ID"
paths:
- build
tags:
- archlinux
before_script:
- source ./venv/bin/activate
configure:
stage: setup
before_script:
- python3 -m venv venv
- source ./venv/bin/activate
- python3 -m pip install -r requirements.txt
script:
- CC=gcc meson setup build -Dstrict_flags=true -Dyaml_project_compatibility=enabled -Dforce_fallback_for=gtk4,libadwaita,libpanel,yyjson,libcyaml -Dtests=true -Db_sanitize=address
clang-format-check:
stage: check
script:
- ninja -C build clang-format-check
reuse-check:
stage: check
script:
- reuse lint
exif-check:
stage: check
script:
- scripts/exif_check.sh
build:
stage: build
script:
- ninja -C build
test:
stage: test
script:
- ninja -C build test || (cat build/meson-logs/testlog.txt && exit 1)
update_manual:
stage: deploy
only:
- master
- tags
script:
- ninja -C build manual_bundle &> manual_bundle_results.txt || (cat manual_bundle_results.txt && exit 1)
- rsync -av --no-group --omit-dir-times --exclude '*.zip' build/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
- source ./venv/bin/activate
update_dev_docs:
stage: deploy
only:
- master
- tags
script:
- ninja -C build gen-dev-docs &> gen_dev_docs_results.txt || (cat gen_dev_docs_results.txt && exit 1)
- rsync -av --no-group --omit-dir-times build/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
- source ./venv/bin/activate
variables:
GIT_SUBMODULE_STRATEGY: recursive
cleanup-cache:
stage: cleanup
script:
- rm -rf "$CI_CACHE_PATH/$CI_PROJECT_PATH/$CI_PIPELINE_ID"-*
when: always