.gitlab-ci.yml 6.31 KB
Newer Older
1
image: debian:unstable
Adam Reichold's avatar
Adam Reichold committed
2

3 4 5 6 7
stages:
  - build
  - document
  - publish

Adam Reichold's avatar
Adam Reichold committed
8
before_script:
9 10
  - echo 'deb-src http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list
  - apt-get update
11
  - apt-get build-dep --yes --no-install-recommends poppler
12
  - apt-get install --yes --no-install-recommends ninja-build libcurl4-openssl-dev git ca-certificates locales libc++-dev libc++abi-dev clang libgtk-3-dev clang-tidy wget p7zip-full libbrotli-dev
13 14 15 16 17 18 19
  - echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
  - locale-gen

variables:
  LANG: en_US.UTF-8
  LANGUAGE: en_US:en
  LC_ALL: en_US.UTF-8
20
  DEBIAN_FRONTEND: noninteractive
21
  TEST_DATA_URL: https://gitlab.freedesktop.org/${CI_PROJECT_NAMESPACE}/test.git
22
  UPSTREAM_TEST_DATA_URL: https://gitlab.freedesktop.org/poppler/test.git
Adam Reichold's avatar
Adam Reichold committed
23

24 25 26 27 28
cache:
  key: "$CI_BUILD_NAME"
  paths:
    - build/

29 30 31 32 33 34 35 36 37
clang_format:
  stage: build
  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

Adam Reichold's avatar
Adam Reichold committed
38 39 40
build:
  stage: build
  script:
41 42 43 44
    - wget -r -l1 -np "http://download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt6_600/qt.qt6.600.gcc_64/" -A "6.0.0-0-*qtbase-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z"
    - 7z x download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt6_600/qt.qt6.600.gcc_64/6.0.0-0-*qtbase-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z
    - wget -r -l1 -np "http://download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt6_600/qt.qt6.600.gcc_64/" -A "6.0.0-0-*icu-linux-Rhel7.2-x64.7z"
    - 7z x download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt6_600/qt.qt6.600.gcc_64/6.0.0-0-*icu-linux-Rhel7.2-x64.7z
45
    - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
46
    - mkdir -p build && cd build
Albert Astals Cid's avatar
Albert Astals Cid committed
47
    - cmake -G Ninja -DTESTDATADIR=$PWD/../test-data .. -DCMAKE_PREFIX_PATH=$PWD/../6.0.0/gcc_64/lib/cmake
Adam Reichold's avatar
Adam Reichold committed
48
    - ninja
49
    - ctest --output-on-failure
50 51 52 53

build_clang_libcpp:
  stage: build
  script:
54
    - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
55
    - mkdir -p build && cd build
56
    - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-use-bool-literals,modernize-redundant-void-arg,modernize-loop-convert,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation,-bugprone-sizeof-expression,-bugprone-branch-clone;-warnings-as-errors=*" ..
57 58
    - ninja
    - ctest --output-on-failure
59

Albert Astals Cid's avatar
Albert Astals Cid committed
60
build_ubuntu_16_04:
61
  stage: build
Albert Astals Cid's avatar
Albert Astals Cid committed
62
  image: ubuntu:xenial
63 64
  before_script:
    - apt-get update
65
    - apt-get install --yes --no-install-recommends build-essential cmake ninja-build libjpeg-dev libopenjp2-7-dev qtbase5-dev gobject-introspection libglib2.0-dev libgtk-3-dev libgirepository1.0-dev libnss3-dev ca-certificates libcurl4-nss-dev liblcms2-dev
66 67 68 69
  script:
    - mkdir -p build && cd build
    - cmake -G Ninja ..
    - ninja
Albert Astals Cid's avatar
Albert Astals Cid committed
70 71 72 73 74

build_mingw64_fedora:
  stage: build
  image: fedora
  before_script:
75 76
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y mingw64-poppler
77
    - dnf -y install glibc-langpack-en make ninja-build
Albert Astals Cid's avatar
Albert Astals Cid committed
78 79
  script:
    - mkdir -p build && cd build
80
    - mingw64-cmake -G Ninja ..
Albert Astals Cid's avatar
Albert Astals Cid committed
81
    - ninja
Albert Astals Cid's avatar
Albert Astals Cid committed
82 83 84 85

build_clazy:
  stage: build
  script:
86
    - apt-get install --yes --no-install-recommends clazy
Albert Astals Cid's avatar
Albert Astals Cid committed
87
    - mkdir -p build && cd build
Albert Astals Cid's avatar
Albert Astals Cid committed
88
    - CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -G Ninja ..
Albert Astals Cid's avatar
Albert Astals Cid committed
89
    - CLAZY_CHECKS="level0,level1,level2,isempty-vs-count,qhash-with-char-pointer-key,tr-non-literal,no-non-pod-global-static" ninja
Aleix Pol's avatar
Aleix Pol committed
90 91 92

build_android:
  stage: build
93
  image: kdeorg/android-sdk
Aleix Pol's avatar
Aleix Pol committed
94
  before_script:
95 96 97
    - wget https://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.xz
    - tar xvfh freetype-2.10.1.tar.xz
    - pushd freetype-2.10.1
98
    - CFLAGS=-std=gnu99 STANDALONE_EXTRA="--arch arm64" /opt/helpers/build-standalone "./autogen.sh && ./configure --enable-shared=no --prefix=/opt/popplerandroid-deps --host=aarch64-linux-android && make -j`nproc` && make install"
Aleix Pol's avatar
Aleix Pol committed
99 100 101
    - popd
  script:
    - mkdir -p build && cd build
102
    - 'ANDROID_ARCH_ABI=arm64-v8a cmake -G Ninja ..
103
                         -DCMAKE_ANDROID_API=28
Aleix Pol's avatar
Aleix Pol committed
104 105 106 107 108
                         -DCMAKE_INSTALL_PREFIX="/opt/popplerandroid-deps"
                         -DCMAKE_PREFIX_PATH="$QT_ANDROID;/opt/popplerandroid-deps"
                         -DCMAKE_BUILD_TYPE=debug
                         -DCMAKE_POSITION_INDEPENDENT_CODE=OFF
                         -DENABLE_DCTDECODER=unmaintained
109 110
                         -DENABLE_LIBOPENJPEG=unmaintained
                         -DCMAKE_TOOLCHAIN_FILE=/opt/nativetooling/share/ECM/toolchain/Android.cmake'
Aleix Pol's avatar
Aleix Pol committed
111
    - ninja && ninja install
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

qt5_docs:
  only:
    - master
  stage: document
  variables:
    QT_SELECT: qt5
  script:
    - apt-get install --yes --no-install-recommends doxygen graphviz qtchooser qttools5-dev-tools
    - cd qt5/src
    - doxygen
  cache: {}
  artifacts:
    paths:
      - qt5/src/APIDOCS-html

128 129 130 131 132 133 134 135 136 137 138 139 140
cpp_docs:
  only:
    - master
  stage: document
  script:
    - apt-get install --yes --no-install-recommends doxygen graphviz
    - cd cpp
    - doxygen
  cache: {}
  artifacts:
    paths:
      - cpp/APIDOCS-html

141 142 143 144 145 146 147 148 149 150 151 152 153 154
glib_docs:
  only:
    - master
  stage: document
  script:
    - apt-get install --yes --no-install-recommends gtk-doc-tools
    - mkdir -p build && cd build
    - cmake -G Ninja -DENABLE_GTK_DOC=YES ..
    - ninja glib-docs
  cache: {}
  artifacts:
    paths:
      - build/glib/reference/html

155 156 157 158 159 160 161 162 163 164 165
trigger_pages:
  only:
    - master
  stage: publish
  image: alpine:latest
  before_script:
    - apk --update upgrade
    - apk add curl ca-certificates
  script:
    - 'curl --request POST --form "token=$WEB_PAGE_TRIGGER" --form ref=master https://gitlab.freedesktop.org/api/v4/projects/poppler%2Fpoppler-web-page/trigger/pipeline'
  cache: {}