image: fedora:latest

before_script:
  - dnf install 'dnf-command(copr)' git libtool make libasan -y
  - dnf copr enable @spice/nightly -y
  - dnf builddep spice -y

makecheck:
  script:
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer'
    LDFLAGS='-fsanitize=address -lasan'
    ./autogen.sh
  - make
  - make -C server check || (cat server/tests/test-suite.log && exit 1)

statistics:
  script:
  - ./autogen.sh --enable-statistics
  - make
  - make -C server check || (cat server/tests/test-suite.log && exit 1)

check-valgrind:
  script:
  - dnf debuginfo-install spice-server -y
  - dnf install valgrind -y
  - ./autogen.sh --enable-valgrind
  - make
  - make check-valgrind || (cat server/tests/test-suite-memcheck.log && exit 1)

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

image: fedora:latest

before_script:
  - dnf install 'dnf-command(copr)' git libtool make libasan -y
  - dnf copr enable @spice/nightly -y
  - dnf builddep spice -y

makecheck:
  script:
  - >
    CFLAGS='-O2 -pipe -g -fsanitize=address -fno-omit-frame-pointer'
    LDFLAGS='-fsanitize=address -lasan'
    ./autogen.sh
  - make
  - make -C server check || (cat server/tests/test-suite.log && exit 1)

statistics:
  script:
  - ./autogen.sh --enable-statistics
  - make
  - make -C server check || (cat server/tests/test-suite.log && 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 -y
  - >
    dnf install valgrind
    gstreamer1-libav gstreamer1-plugins-ugly gstreamer1-plugins-good gstreamer1-plugins-bad-free
    -y
  - ./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

Make possible to execute additional expensive checks on GitLab
ci: Make possible to execute additional expensive checks on GitLab

Install missing GStreamer plugins and enable these checks.
Currently the checks are enabled if valgrind is used.
This as the main "makecheck" job uses address sanitizer which
detects some leaks due to some Glib usage. Valgrind checks uses
some suppression for some Glib leaks so they will work correctly.

Signed-off-by: Frediano Ziglio <55d48b080b2e443e395cde84d2c83b135a4ff48e@redhat.com>
Acked-by: Pavel Grunt <fbda40b445316123f12a5a6bd7556918ea74f4bc@redhat.com>
