summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: bdb095bf0a2537d0f9a757c9754b44a4dc33024e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
image: fedora:latest

before_script:
  - >
    dnf install 'dnf-command(debuginfo-install)' git libtool make libasan orc-devel
    python3 python3-six python3-pyparsing glib-networking
    asciidoc bzip2 meson ninja-build file diffutils
    glib2-devel pixman-devel alsa-lib-devel openssl-devel libjpeg-turbo-devel
    libcacard-devel cyrus-sasl-devel lz4-devel opus-devel
    gstreamer1-devel gstreamer1-plugins-base-devel
    dconf gcc-c++ autoconf-archive
    -y
  - &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
  # 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

makecheck:
  script:
  # Also check out-of-tree build
  - git clean -fdx # cleanup after previous builds
  - git submodule foreach --recursive git clean -fdx
  - mkdir builddir
  - cd builddir
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    LDFLAGS='-fsanitize=address -lasan'
    ../autogen.sh --enable-werror
  - make
  - make -C server check || (cat server/tests/test-suite.log && exit 1)

meson-makecheck:
  script:
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    LDFLAGS='-fsanitize=address -lasan'
    meson --buildtype=release --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
  - ninja -C build
  - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)

# check non-standard options, currently
# --enable-statistics  compile statistic code
# --without-sasl       disable SASL
options:
  script:
  - ./autogen.sh --enable-statistics --without-sasl --enable-werror
  - make
  - make -C server check || (cat server/tests/test-suite.log && exit 1)

meson-options:
  script:
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
  - meson --buildtype=release --werror -Dstatistics=true -Dsasl=false build
  - ninja -C build
  - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)

check-valgrind:
  script:
  - dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -y
  - dnf debuginfo-install spice-server glib2 -y
  - >
    dnf install valgrind
    gstreamer1-libav gstreamer1-plugins-ugly gstreamer1-plugins-good gstreamer1-plugins-bad-free
    -y
  - dnf downgrade -y gstreamer1-plugins-good-1.20.0-1.fc36
  - >
    CFLAGS='-O2 -pipe -g -D_FORTIFY_SOURCE=0'
    CXXFLAGS='-O2 -pipe -g -D_FORTIFY_SOURCE=0'
    ./autogen.sh --enable-valgrind --enable-extra-checks
  - make
  - make check-valgrind || (cat server/tests/test-suite-memcheck.log && exit 1)

syntax-check:
  script:
  - ./autogen.sh
  - make syntax-check

distcheck:
  script:
  - ./autogen.sh --enable-manual --enable-werror
  - make distcheck

# Same as makecheck job but use a Centos image
makecheck-centos:
  before_script:
    - dnf install -y 'dnf-command(config-manager)'
    - dnf config-manager --set-enabled powertools
    - >
      dnf install git libtool make libasan orc-devel glib-networking
      gcc glib2-devel diffutils
      opus-devel pixman-devel openssl-devel libjpeg-devel
      libcacard-devel cyrus-sasl-devel lz4-devel
      gstreamer1-devel gstreamer1-plugins-base-devel
      git-core python3-pyparsing python3-six python3
      meson gcc-c++ autoconf-archive
      -y
    - *protocol
  image: quay.io/centos/centos:stream8
  script:
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    LDFLAGS='-fsanitize=address -lasan'
    ./autogen.sh --enable-werror
  - make
  - make -C server check || (cat server/tests/test-suite.log && exit 1)

# Same as meson-makecheck job but use a Debian i386 image,
# this in order to test a 32 bit machine
makecheck-debian32:
  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
      libspice-protocol-dev libssl-dev pkg-config
      python3-six python3-pyparsing liborc-0.4-dev meson git
      g++ autoconf-archive
    - *protocol
  image: i386/debian:latest
  script:
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    CXXFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer -Wframe-larger-than=40920'
    LDFLAGS='-fsanitize=address -lasan'
    meson --buildtype=release --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
  - ninja -C build
  - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)

# Same as makecheck job but use Windows build
makecheck-windows:
  script:
  - >
    dnf install -y
    wine 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
    meson
  - mkdir spice-protocol/build
  - (cd spice-protocol/build && mingw64-meson --werror && ninja install)
  - NOCONFIGURE=yes ./autogen.sh
  - mingw64-configure
  - mingw64-make
  - export G_TLS_GNUTLS_PRIORITY="NORMAL:%COMPAT"
  - export WINEPATH='Z:\usr\x86_64-w64-mingw32\sys-root\mingw\bin'
  - export LANG=en_US.UTF-8
  - (cd server && exec mingw64-make LOG_COMPILE=wine check) || (cat server/tests/test-suite.log && exit 1)

websocket-autobahn:
  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
  script:
  - pip2 install 'wsaccel==0.6.3'
  - pip2 install autobahntestsuite
  - wstest -a
  - git clean -fdx
  - git submodule foreach --recursive git clean -fdx
  - >
    meson --buildtype=release build || (cat build/meson-logs/meson-log.txt && exit 1)
  - ninja -C build
  - build/server/tests/test-websocket & pid=$!
  - wstest -m fuzzingclient -s server/tests/fuzzingclient.json
  - kill $pid
  - server/tests/autobahn-check-report reports/servers/index.json
  - rm -rf reports/servers
  - build/server/tests/test-websocket -n & pid=$!
  - wstest -m fuzzingclient -s server/tests/fuzzingclient.json
  - kill $pid
  - server/tests/autobahn-check-report reports/servers/index.json

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