.gitlab-ci.yml 2.43 KB
Newer Older
1 2 3
variables:
  DEBIAN_FRONTEND: "noninteractive"

Albert Astals Cid's avatar
Albert Astals Cid committed
4 5 6 7
include:
  - https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-before.yml
  - https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-applications-linux.yml

8 9 10 11 12 13 14 15 16
build_ubuntu_20_04:
  stage: build
  image: ubuntu:focal
  only:
    - merge_requests
  before_script:
    - sed -i -e 's/# deb-src/deb-src/g' /etc/apt/sources.list
    - apt-get update
    - apt-get build-dep --yes --no-install-recommends okular
17
    - apt-get install --yes --no-install-recommends ninja-build
18 19 20 21 22 23 24 25
  script:
    - mkdir -p build && cd build
    - cmake -DOKULAR_UI=desktop -G Ninja ..
    - ninja
    - rm -rf *
    - cmake -DOKULAR_UI=mobile -G Ninja ..
    - ninja

26
build_clazy_clang_tidy:
27
  stage: build
28
  image: debian:testing
29 30 31 32 33 34
  only:
    - merge_requests
  before_script:
    - echo 'deb-src http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list
    - apt-get update
    - apt-get build-dep --yes --no-install-recommends okular
35
    - apt-get install --yes --no-install-recommends ninja-build clazy clang clang-tidy libkf5crash-dev libkf5purpose-dev libegl-dev jq
36 37

  script:
38
    - srcdir=`pwd` && mkdir -p /tmp/okular_build && cd /tmp/okular_build && CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja $srcdir && cat compile_commands.json | jq  '[.[] | select(.file | contains("'"$srcdir"'"))]' > compile_commands.aux.json && cat compile_commands.aux.json | jq  '[.[] | select(.file | contains("/synctex/")| not)]' > compile_commands.json && cp "$srcdir/.clang-tidy" .
39
    - CLAZY_IGNORE_DIRS="settings_core.[cpp|h]|settings.[cpp.h]|pdfsettings.h|gssettings.h" CLAZY_CHECKS="level0,level1,level2,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch" ninja
40 41
    # Fix the poppler header, remove when debian:unstable ships poppler 0.82 or later
    - sed -i "N;N;N;N; s#class MediaRendition\;\nclass MovieAnnotation\;\nclass ScreenAnnotation;#class MediaRendition\;#g"  /usr/include/poppler/qt5/poppler-link.h
42
    - run-clang-tidy
43 44 45 46 47 48 49 50 51 52 53 54 55

clang_format:
  stage: build
  image: debian:testing
  only:
    - merge_requests
    - master
  before_script:
    - apt-get update
    - apt-get install --yes --no-install-recommends git clang-format-10
  script:
    - find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format-10 -i {} \;
    - git diff --exit-code