include:
    - project: 'steam/steam-ci-pipeline'
      file: '/steam-gitlab-ci-common.yml'

    - project: 'steam/steam-ci-pipeline'
      file: '/steam-gitlab-ci-pipeline.yml'

variables:
    BUILD_IMAGE: docker.internal.steamos.cloud/steamos/package-builder:buster
    STEAM_CI_USE_BINARIES_FROM: autopkgtest
    STEAM_CI_DEPENDENCIES: >-
        debhelper
        gtk-doc-tools
        libegl1-mesa-dev
        libgl1-mesa-dev
        libgles2-mesa-dev
        libglib2.0-dev
        libjson-glib-dev
        libx11-dev
        libxcomposite-dev
        locales
        meson
        pandoc

stages:
    - build
    - test

autopkgtest:
    stage: test
    variables:
        BUILD_IMAGE: docker.internal.steamos.cloud/steamrt/sdk:scout-latest

ubsan:
    stage: test
    image: "${BUILD_IMAGE}"
    script:
        - |
            set -eux
            export DEBIAN_FRONTEND=noninteractive

            apt-get install -y --no-install-recommends \
                ccache \
                clang \
                clang-tools \
                ${NULL+}

            export CC=clang

            rm -fr builddir
            meson \
                -Db_lundef=false \
                -Db_sanitize=address,undefined \
                builddir
            ninja -C builddir scan-build
            meson test -C builddir -v
