.option_tester: &option_tester
  stage: test
  after_script:
    - PYTHON=python2 bash tests/option-tester.sh
    - PYTHON=python3 bash tests/option-tester.sh
  tags:
    - gitlab-org
  only:
    - schedules

alpine-edge-options-tester:
  <<: *option_tester
  image: alpine:edge
  script:
    - apk update && apk add gcc bison musl-dev openssl-dev libcap-dev python2-dev python3-dev asciidoc libseccomp-dev bash

alpine-options-tester:
  <<: *option_tester
  image: alpine
  script:
    - apk update && apk add gcc bison musl-dev openssl-dev libcap-dev python2-dev python3-dev asciidoc libseccomp-dev bash

centos-options-tester:
  <<: *option_tester
  image: centos:latest
  script:
    - dnf -y --enablerepo=PowerTools install bison gcc openssl-devel libcap-devel python3-devel python2-devel pps-tools-devel libseccomp-devel bash

fedora-latest-options-tester:
  image: fedora:latest
  script:
    - yum -y install bison gcc openssl-devel libcap-devel pps-tools-devel python3-devel python2-devel libseccomp-devel bash
  <<: *option_tester

fedora-rawhide-options-tester:
  image: registry.fedoraproject.org/fedora:rawhide
  script:
    - yum -y install bison gcc openssl-devel libcap-devel pps-tools-devel python3-devel python2-devel libseccomp-devel bash
  <<: *option_tester

opensuse-leap-options-tester:
  <<: *option_tester
  image: opensuse/leap
  script:
    - zypper -n install bison gcc libopenssl-devel libcap-devel pps-tools-devel python-devel python-curses libseccomp-devel python3-devel python3-curses bash

opensuse-tumbleweed-options-tester:
  <<: *option_tester
  image: opensuse/tumbleweed
  script:
    - zypper -n install bison gcc libopenssl-devel libcap-devel pps-tools-devel python-devel python-curses libseccomp-devel python3-devel python3-curses bash

gentoo-options-tester:
  <<: *option_tester
  image: gentoo/stage3-amd64
  script:
    - emerge-webrsync
    - emerge -q y sys-libs/libcap sys-devel/bison net-misc/pps-tools app-text/asciidoc sys-libs/libseccomp app-shells/bash

gentoo-hardened-options-tester:
  <<: *option_tester
  image: gentoo/stage3-amd64-hardened
  script:
    - emerge-webrsync
    - emerge -q y sys-libs/libcap sys-devel/bison net-misc/pps-tools app-text/asciidoc sys-libs/libseccomp app-shells/bash

macos-options-tester:
  stage: test
  script:
    - PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig PYTHON=python2 tests/option-tester.sh
    - PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig PYTHON=python3 tests/option-tester.sh
  tags:
    - macos
  only:
    - branches@NTPsec/ntpsec AND schedules

fbsd-11-options-tester:
  stage: test
  script:
    - PYTHON=python2 tests/option-tester.sh
    - PYTHON=python3 tests/option-tester.sh
  tags:
    - freebsd-11
  only:
    - branches@NTPsec/ntpsec AND schedules

fbsd-12-options-tester:
  stage: test
  script:
    - PYTHON=python2 tests/option-tester.sh
    - PYTHON=python3 tests/option-tester.sh
  tags:
    - freebsd-11
  only:
    - branches@NTPsec/ntpsec AND schedules

.deb_option_tester: &deb_option_tester
  stage: test
  script:
    - apt-get update
    - DEBIAN_FRONTEND=noninteractive apt-get install -y netbase bison gcc libssl-dev libcap-dev pps-tools python2-dev python2-minimal libseccomp-dev bash pkg-config python3-dev python3-minimal
    - PYTHON=python2 bash tests/option-tester.sh
    - PYTHON=python3 bash tests/option-tester.sh
  tags:
    - gitlab-org
  only:
    - schedules

.deb_old_option_tester: &deb_old_option_tester
  stage: test
  script:
    - apt-get update
    - apt-get install -y netbase bison gcc libssl-dev libcap-dev pps-tools python-dev python-minimal libseccomp-dev bash pkg-config python3-dev python3-minimal
    - PYTHON=python bash tests/option-tester.sh
    - PYTHON=python3 bash tests/option-tester.sh
  tags:
    - gitlab-org
  only:
    - schedules

debian-i386-options-tester:
  image: i386/debian:stable-slim
  <<: *deb_option_tester

debian-oldstable-options-tester:
  image: debian:oldstable-slim
  <<: *deb_old_option_tester

debian-stable-options-tester:
  image: debian:stable-slim
  <<: *deb_option_tester

debian-testing-options-tester:
  image: debian:testing-slim
  <<: *deb_option_tester

debian-unstable-options-tester:
  image: debian:unstable-slim
  <<: *deb_option_tester

ubuntu-devel-options-tester:
  image: ubuntu:devel
  <<: *deb_option_tester

ubuntu-latest-options-tester:
  image: ubuntu:latest
  <<: *deb_option_tester

ubuntu-rolling-options-tester:
  image: ubuntu:rolling
  <<: *deb_option_tester
