.gitlab-ci.yml 5.04 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
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/

Adam Reichold's avatar
Adam Reichold committed
29
30
31
build:
  stage: build
  script:
32
    - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
33
    - mkdir -p build && cd build
34
    - cmake -G Ninja -DTESTDATADIR=$PWD/../test-data ..
Adam Reichold's avatar
Adam Reichold committed
35
    - ninja
36
    - ctest --output-on-failure
37
38
39
40

build_clang_libcpp:
  stage: build
  script:
41
    - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
42
    - mkdir -p build && cd build
43
    - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data ..
44
45
    - ninja
    - ctest --output-on-failure
46

Albert Astals Cid's avatar
Albert Astals Cid committed
47
build_ubuntu_16_04:
48
  stage: build
Albert Astals Cid's avatar
Albert Astals Cid committed
49
  image: ubuntu:xenial
50
51
  before_script:
    - apt-get update
Albert Astals Cid's avatar
Albert Astals Cid committed
52
    - 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
53
54
55
56
  script:
    - mkdir -p build && cd build
    - cmake -G Ninja ..
    - ninja
Albert Astals Cid's avatar
Albert Astals Cid committed
57
58
59
60
61

build_mingw64_fedora:
  stage: build
  image: fedora
  before_script:
62
63
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y mingw64-poppler
64
    - dnf -y install glibc-langpack-en mingw64-curl make ninja-build mingw64-openjpeg2-tools mingw32-openjpeg2-tools
Albert Astals Cid's avatar
Albert Astals Cid committed
65
66
  script:
    - mkdir -p build && cd build
Albert Astals Cid's avatar
Albert Astals Cid committed
67
    - mingw64-cmake -G Ninja .. -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/include/
Albert Astals Cid's avatar
Albert Astals Cid committed
68
    - ninja
Albert Astals Cid's avatar
Albert Astals Cid committed
69
70
71

build_clazy:
  stage: build
72
  image: fedora
Albert Astals Cid's avatar
Albert Astals Cid committed
73
74
75
  before_script:
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y poppler
76
    - dnf -y install glibc-langpack-en curl make ninja-build openjpeg2-tools clazy clang redhat-rpm-config
Albert Astals Cid's avatar
Albert Astals Cid committed
77
78
  script:
    - mkdir -p build && cd build
Albert Astals Cid's avatar
Albert Astals Cid committed
79
    - CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -G Ninja ..
Albert Astals Cid's avatar
Albert Astals Cid committed
80
    - 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
81
82
83

build_android:
  stage: build
84
  image: kdeorg/android-aarch64-sdk
Aleix Pol's avatar
Aleix Pol committed
85
86
87
  before_script:
    - git clone https://git.savannah.gnu.org/git/freetype/freetype2.git --single-branch -b VER-2-8-1
    - pushd freetype2
88
    - CFLAGS=-std=gnu99 /opt/helpers/build-standalone "./autogen.sh && ./configure --enable-shared=no --prefix=/opt/popplerandroid-deps --host=${ANDROID_NDK_TOOLCHAIN_PREFIX} && make -j`nproc` && make install"
Aleix Pol's avatar
Aleix Pol committed
89
90
91
92
93
    - popd
  script:
    - mkdir -p build && cd build
    - 'cmake -G Ninja .. -DCMAKE_SYSTEM_NAME=Android
                         -DCMAKE_ANDROID_STL_TYPE=c++_shared
94
95
                         -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
                         -DCMAKE_ANDROID_API=28
Aleix Pol's avatar
Aleix Pol committed
96
97
98
99
100
101
                         -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang
                         -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
102
                         -DENABLE_LIBOPENJPEG=unmaintained'
Aleix Pol's avatar
Aleix Pol committed
103
    - ninja && ninja install
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119

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

120
121
122
123
124
125
126
127
128
129
130
131
132
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

133
134
135
136
137
138
139
140
141
142
143
144
145
146
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

147
148
149
150
151
152
153
154
155
156
157
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: {}