.gitlab-ci.yml 7.79 KB
Newer Older
Pavel Grunt's avatar
Pavel Grunt committed
1 2 3
image: fedora:latest

before_script:
4
  - >
5
    dnf install 'dnf-command(debuginfo-install)' git libtool make libasan orc-devel
6
    python3 python3-six python3-pyparsing glib-networking
Uri Lublin's avatar
Uri Lublin committed
7
    asciidoc bzip2 meson ninja-build file diffutils
Frediano Ziglio's avatar
Frediano Ziglio committed
8
    glib2-devel pixman-devel alsa-lib-devel openssl-devel libjpeg-turbo-devel
9 10
    libcacard-devel cyrus-sasl-devel lz4-devel opus-devel
    gstreamer1-devel gstreamer1-plugins-base-devel
11
    dconf gcc-c++ autoconf-archive
12
    -y
13 14 15 16 17
  - &protocol >
    git clone ${CI_REPOSITORY_URL/spice.git/spice-protocol.git} &&
    meson --buildtype=release spice-protocol build-spice-protocol --prefix=/usr --werror &&
    ninja -C build-spice-protocol install &&
    rm -rf build-spice-protocol
18 19 20 21 22 23
  # This is a workaround for Fedora docker image, this will add some
  # missing configuration
  # '/org/gnome/system/location/enabled' is just the first key path
  # I found, nothing special in it
  # TODO remove when the image will fix this issue
  - dconf reset /org/gnome/system/location/enabled || true
Pavel Grunt's avatar
Pavel Grunt committed
24 25 26

makecheck:
  script:
Uri Lublin's avatar
Uri Lublin committed
27 28 29 30 31
  # Also check out-of-tree build
  - git clean -fdx # cleanup after previous builds
  - git submodule foreach --recursive git clean -fdx
  - mkdir builddir
  - cd builddir
32
  - >
33
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
34
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
35
    LDFLAGS='-fsanitize=address -lasan'
Frediano Ziglio's avatar
Frediano Ziglio committed
36
    ../autogen.sh
Pavel Grunt's avatar
Pavel Grunt committed
37
  - make
38
  - make -C server check || (cat server/tests/test-suite.log && exit 1)
Pavel Grunt's avatar
Pavel Grunt committed
39

40 41
meson-makecheck:
  script:
42 43
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
44 45
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
46
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
47
    LDFLAGS='-fsanitize=address -lasan'
Frediano Ziglio's avatar
Frediano Ziglio committed
48
    meson --buildtype=release --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
49 50 51
  - ninja -C build
  - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)

52 53 54 55
# check non-standard options, currently
# --enable-statistics  compile statistic code
# --without-sasl       disable SASL
options:
Pavel Grunt's avatar
Pavel Grunt committed
56
  script:
Frediano Ziglio's avatar
Frediano Ziglio committed
57
  - ./autogen.sh --enable-statistics --without-sasl
Pavel Grunt's avatar
Pavel Grunt committed
58
  - make
59
  - make -C server check || (cat server/tests/test-suite.log && exit 1)
Pavel Grunt's avatar
Pavel Grunt committed
60

61 62
meson-options:
  script:
63 64
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
Frediano Ziglio's avatar
Frediano Ziglio committed
65
  - meson --buildtype=release --werror -Dstatistics=true -Dsasl=false build
66 67 68
  - ninja -C build
  - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)

Pavel Grunt's avatar
Pavel Grunt committed
69 70
check-valgrind:
  script:
71
  - dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -y
72
  - dnf debuginfo-install spice-server glib2 -y
73 74 75 76
  - >
    dnf install valgrind
    gstreamer1-libav gstreamer1-plugins-ugly gstreamer1-plugins-good gstreamer1-plugins-bad-free
    -y
77 78
  - >
    CFLAGS='-O2 -pipe -g -D_FORTIFY_SOURCE=0'
79
    CXXFLAGS='-O2 -pipe -g -D_FORTIFY_SOURCE=0'
Frediano Ziglio's avatar
Frediano Ziglio committed
80
    ./autogen.sh --enable-valgrind --enable-extra-checks
Pavel Grunt's avatar
Pavel Grunt committed
81 82 83
  - make
  - make check-valgrind || (cat server/tests/test-suite-memcheck.log && exit 1)

Pavel Grunt's avatar
Pavel Grunt committed
84 85
syntax-check:
  script:
Frediano Ziglio's avatar
Frediano Ziglio committed
86
  - ./autogen.sh
Pavel Grunt's avatar
Pavel Grunt committed
87
  - make syntax-check
Frediano Ziglio's avatar
Frediano Ziglio committed
88 89 90

distcheck:
  script:
Frediano Ziglio's avatar
Frediano Ziglio committed
91
  - ./autogen.sh --enable-manual
Frediano Ziglio's avatar
Frediano Ziglio committed
92
  - make distcheck
93 94 95 96

# Same as makecheck job but use a Centos image
makecheck-centos:
  before_script:
97
    - dnf install -y 'dnf-command(config-manager)'
98
    - dnf config-manager --set-enabled powertools
99
    - >
100 101
      dnf install git libtool make libasan orc-devel glib-networking
      gcc glib2-devel
102 103 104
      opus-devel pixman-devel openssl-devel libjpeg-devel
      libcacard-devel cyrus-sasl-devel lz4-devel
      gstreamer1-devel gstreamer1-plugins-base-devel
105
      git-core python3-pyparsing python3-six python3
106
      meson gcc-c++ autoconf-archive
107
      -y
108
    - *protocol
109 110 111 112
  image: centos:latest
  script:
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
113
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
114
    LDFLAGS='-fsanitize=address -lasan'
Frediano Ziglio's avatar
Frediano Ziglio committed
115
    ./autogen.sh
116 117
  - make
  - make -C server check || (cat server/tests/test-suite.log && exit 1)
118

119 120 121
# Same as meson-makecheck job but use a Debian i386 image,
# this in order to test a 32 bit machine
makecheck-debian32:
122
  before_script:
123
    - apt-get update -y
124
    - >
125 126 127 128 129 130 131 132 133
      apt-get install -y
      debhelper
      gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-good
      gstreamer1.0-plugins-ugly gstreamer1.0-tools
      libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
      libcacard-dev libglib2.0-dev
      libjpeg-dev liblz4-dev libopus-dev libpixman-1-dev libsasl2-dev
      libspice-protocol-dev libssl-dev pkg-config
      python3-six python3-pyparsing liborc-0.4-dev meson git
134
      g++ autoconf-archive
135
    - *protocol
136
  image: i386/debian:latest
137
  script:
138 139
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
140 141
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
142
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
143
    LDFLAGS='-fsanitize=address -lasan'
Frediano Ziglio's avatar
Frediano Ziglio committed
144
    meson --buildtype=release --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
145 146
  - ninja -C build
  - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)
147

148 149 150 151 152 153 154 155 156
# Same as makecheck job but use Windows build
makecheck-windows:
  script:
  - >
    dnf install -y
    wine-core.x86_64 mingw64-gcc-c++
    mingw64-openssl mingw64-glib2 mingw64-glib-networking mingw64-libjpeg-turbo
    mingw64-pixman mingw64-opus mingw64-winpthreads mingw64-zlib
    mingw64-gstreamer1-plugins-base mingw64-gstreamer1-plugins-good mingw64-orc
157 158
    meson
  - mkdir spice-protocol/build
159
  - (cd spice-protocol/build && mingw64-meson --werror && ninja install)
160
  - NOCONFIGURE=yes ./autogen.sh
Frediano Ziglio's avatar
Frediano Ziglio committed
161
  - mingw64-configure
162
  - mingw64-make
163
  - export G_TLS_GNUTLS_PRIORITY="NORMAL:%COMPAT"
164
  - mingw64-make LOG_COMPILE=wine -C server check || (cat server/tests/test-suite.log && exit 1)
Frediano Ziglio's avatar
Frediano Ziglio committed
165 166

websocket-autobahn:
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
  before_script:
    - apt-get update -y
    - >
      apt-get install -y
      debhelper
      gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-good
      gstreamer1.0-plugins-ugly gstreamer1.0-tools
      libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
      libcacard-dev libglib2.0-dev
      libjpeg-dev liblz4-dev libopus-dev libpixman-1-dev libsasl2-dev
      libssl-dev pkg-config
      python3-six python3-pyparsing liborc-0.4-dev git
      g++ autoconf-archive python-pip
      python3 python3-pip python3-setuptools python3-wheel ninja-build
    - pip3 install meson
    - *protocol
  image: ubuntu:bionic
Frediano Ziglio's avatar
Frediano Ziglio committed
184
  script:
185 186
  - pip2 install autobahntestsuite
  - wstest -a
187 188
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
189
  - >
Frediano Ziglio's avatar
Frediano Ziglio committed
190
    meson --buildtype=release build || (cat build/meson-logs/meson-log.txt && exit 1)
191 192
  - ninja -C build
  - build/server/tests/test-websocket & pid=$!
Frediano Ziglio's avatar
Frediano Ziglio committed
193 194 195 196
  - wstest -m fuzzingclient -s server/tests/fuzzingclient.json
  - kill $pid
  - server/tests/autobahn-check-report reports/servers/index.json
  - rm -rf reports/servers
197
  - build/server/tests/test-websocket -n & pid=$!
Frediano Ziglio's avatar
Frediano Ziglio committed
198 199 200
  - wstest -m fuzzingclient -s server/tests/fuzzingclient.json
  - kill $pid
  - server/tests/autobahn-check-report reports/servers/index.json
201 202

trigger-website-update:
203
  image: ruby:latest
204
  before_script:
205
  - gem install asciidoctor
206 207 208 209 210 211 212 213 214
  only:
    variables:
    - $TOKEN
    changes:
    - "docs/*.txt"
    - "docs/images/*"
    - "docs/manual/*.txt"
    - "docs/manual/images/*"
  script:
215 216
  - asciidoctor -d book docs/*.txt docs/manual/*.txt > errors 2>&1
  - if [ -n "$(cat errors)" ] ; then cat errors; exit 1 ; fi
217
  - curl -X POST -F token=$TOKEN -F ref=master https://gitlab.freedesktop.org/api/v4/projects/spice%2Fspice-space/trigger/pipeline