forked from KDE/okular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
82 lines (77 loc) · 3.16 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
variables:
DEBIAN_FRONTEND: "noninteractive"
include:
- project: sysadmin/ci-utilities
file:
- /gitlab-templates/android-qt6.yml
- /gitlab-templates/linux-qt6.yml
- /gitlab-templates/freebsd-qt6.yml
- /gitlab-templates/windows-qt6.yml
- /gitlab-templates/cppcheck.yml
- /gitlab-templates/xml-lint.yml
- /gitlab-templates/craft-windows-x86-64-qt6.yml
# - /gitlab-templates/craft-android-qt6-apks.yml
- /gitlab-templates/craft-macos-arm64-qt6.yml
- /gitlab-templates/craft-macos-x86-64-qt6.yml
#build_ubuntu_22_04:
# stage: build
# image: ubuntu:22.04
# tags:
# - Linux
# only:
# - merge_requests
# before_script:
# - sed -i -e 's/# deb-src/deb-src/g' /etc/apt/sources.list
# - apt-get update
# - apt-get install --yes eatmydata
# - eatmydata apt-get build-dep --yes --no-install-recommends okular
# - eatmydata apt-get install --yes --no-install-recommends ninja-build libqt5x11extras5-dev
# script:
# - mkdir -p build && cd build
# - cmake -DOKULAR_UI=desktop -G Ninja ..
# - ninja
build_clazy_clang_tidy:
stage: build
image: invent-registry.kde.org/sysadmin/ci-images/suse-qt67:latest
tags:
- Linux
interruptible: true
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
only:
- merge_requests
variables:
KDECI_CC_CACHE: /mnt/caches/suse-qt6.7/
KDECI_CACHE_PATH: /mnt/artifacts/suse-qq6.7/
KDECI_GITLAB_SERVER: https://invent.kde.org/
KDECI_PACKAGE_PROJECT: teams/ci-artifacts/suse-qt6.7
CLAZY_CHECKS: level0,level1,level2,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch
CXXFLAGS: -Werror -Wno-deprecated-declarations
CC: clang
CXX: clazy
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 --only-setup-environment
- mkdir -p /tmp/okular_build
- cd /tmp/okular_build
- cmake -DOKULAR_UI=both -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/_install -DFORCE_NOT_REQUIRED_DEPENDENCIES=KF6DocTools -DKF6DocTools_FOUND=false $CI_PROJECT_DIR
- cat compile_commands.json | jq '[.[] | select(.file | contains("'"$CI_PROJECT_DIR"'"))]' > compile_commands.aux.json
- cat compile_commands.aux.json | jq '[.[] | select(.file | contains("/synctex/")| not)]' > compile_commands.json
- cp "$CI_PROJECT_DIR/.clang-tidy" .
- CLAZY_IGNORE_DIRS="settings_core.[cpp|h]|settings.[cpp.h]|pdfsettings.h|gssettings.h|ui_selectcertificatedialog.h" ninja -k 0
- run-clang-tidy
clang_format:
stage: build
image: debian:stable
tags:
- Linux
only:
- merge_requests
- master
before_script:
- apt-get update
- apt-get install --yes --no-install-recommends git clang-format-13
script:
- find . \( -name "*.cpp" -or -name "*.h" -or -name "*.c" -or -name "*.cc" \) -exec clang-format-13 -i {} \;
- git diff --exit-code