language: c
os: linux

cache:
  apt: true

matrix:
  include:
    - env: B=cmake-arm
      compiler: gcc
      sudo: required
      dist: focal
      arch: arm64
      addons:
        apt:
          packages:
            - autoconf-archive
            - docbook-xsl
            - flex
            - gradle
            - libcap-dev
            - libcurl4-openssl-dev
            - libdbd-sqlite3
            - libdbi0-dev
            - libesmtp-dev
            - libglib2.0-dev
            - libhiredis-dev
            - libivykis-dev
            - librabbitmq-dev
            - libmongoc-dev
            - libjson-c-dev
            - m4
            - python3-dev
            - python3-pip
            - python3-setuptools
            - libnet1-dev
            - libriemann-client-dev
            - librdkafka-dev
            - libwrap0-dev
            - pkg-config
            - sqlite3
            - xsltproc
            - libmaxminddb-dev
            - libxml2-utils
            - doxygen
            - libsnmp-dev
            - autopoint
      install:
        - python3 -m pip install --user --cache-dir=$PWD/pip-cache -r requirements.txt
        - python3 -m pip list
      script:
        - set -e
        - git clone https://github.com/Snaipe/Criterion.git -b v2.3.3
        - cd Criterion
        - git submodule update --init
        - cmake .
        - make all
        - sudo make install
        - cd ..

        - wget https://ftp.gnu.org/gnu/bison/bison-3.7.6.tar.gz
        - tar xvf bison-3.7.6.tar.gz
        - cd bison-3.7.6
        - ./configure
        - make all
        - sudo make install
        - cd ..

        - mkdir build
        - cd build
        - cmake
            -DCMAKE_C_FLAGS=-Werror
            -DPYTHON_VERSION=3
            -DCMAKE_INSTALL_PREFIX=$HOME/install/syslog-ng
            ..
        - make --keep-going -j $(nproc) all install
        - ctest -j $(nproc) --output-on-failure

branches:
  except:
    - /wip/
