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

before_script:
4
5
  - echo 'deb-src http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list
  - apt-get update
6
  - apt-get build-dep --yes --no-install-recommends poppler
7
  - apt-get install --yes --no-install-recommends ninja-build libcurl4-openssl-dev git ca-certificates locales libc++-7-dev libc++abi-7-dev clang libgtk-3-dev
8
9
10
11
12
13
14
  - 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
15
  TEST_DATA_URL: https://gitlab.freedesktop.org/${CI_PROJECT_NAMESPACE}/test.git
16
  UPSTREAM_TEST_DATA_URL: https://gitlab.freedesktop.org/poppler/test.git
Adam Reichold's avatar
Adam Reichold committed
17

18
19
20
21
22
cache:
  key: "$CI_BUILD_NAME"
  paths:
    - build/

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

build_clang_libcpp:
  stage: build
  script:
35
    - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
36
    - mkdir -p build && cd build
37
    - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data ..
38
39
    - ninja
    - ctest --output-on-failure
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

build_gcc_49:
  stage: build
  image: ubuntu:trusty
  before_script:
    - apt-get update
    - apt-get install --yes software-properties-common
    - add-apt-repository --yes ppa:ubuntu-toolchain-r/test
    - add-apt-repository --yes ppa:george-edison55/cmake-3.x
    - add-apt-repository --yes ppa:ricotz/testing
    - add-apt-repository --yes ppa:aacid/openjp2trusty
    - apt-get update
    - apt-get install --yes build-essential cmake ninja-build gcc-4.9 g++-4.9 libjpeg-dev libopenjp2-7-dev qtbase5-dev gobject-introspection libglib2.0-dev libgtk-3-dev libgirepository1.0-dev libnss3-dev
    - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
    - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
    - update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 20
  script:
    - mkdir -p build && cd build
    - cmake -G Ninja ..
    - ninja
Albert Astals Cid's avatar
Albert Astals Cid committed
60
61
62
63
64

build_mingw64_fedora:
  stage: build
  image: fedora
  before_script:
65
66
67
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y mingw64-poppler
    - dnf -y install mingw64-curl make ninja-build mingw64-openjpeg2-tools mingw32-openjpeg2-tools
Albert Astals Cid's avatar
Albert Astals Cid committed
68
69
  script:
    - mkdir -p build && cd build
Albert Astals Cid's avatar
Albert Astals Cid committed
70
    - 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
71
    - ninja
Albert Astals Cid's avatar
Albert Astals Cid committed
72
73
74
75
76
77
78
79
80
81

build_clazy:
  stage: build
  image: fedora:rawhide
  before_script:
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y poppler
    - dnf -y install curl make ninja-build openjpeg2-tools clazy clang redhat-rpm-config
  script:
    - mkdir -p build && cd build
82
    - CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -G Ninja ..
Albert Astals Cid's avatar
Albert Astals Cid committed
83
    - 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
84
85
86

build_android:
  stage: build
87
  image: kdeorg/android-sdk
Aleix Pol's avatar
Aleix Pol committed
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
  before_script:
    - git clone https://git.savannah.gnu.org/git/freetype/freetype2.git --single-branch -b VER-2-8-1
    - pushd freetype2
    - ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi CFLAGS=-std=gnu99 /opt/helpers/build-standalone "./autogen.sh && ./configure --prefix=/opt/popplerandroid-deps --host=${ANDROID_NDK_TOOLCHAIN_PREFIX} && make -j`nproc` && make install"
    - popd
  script:
    - mkdir -p build && cd build
    - 'cmake -G Ninja .. -DCMAKE_SYSTEM_NAME=Android
                         -DCMAKE_ANDROID_STL_TYPE=c++_shared
                         -DCMAKE_ANDROID_API=24
                         -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
                         -DENABLE_LIBOPENJPEG=unmaintained
                         -DENABLE_CPP=OFF'
    - ninja && ninja install