language: generic
dist: focal
sudo: required

virt: vm
arch: arm64-graviton2
group: edge

services:
- docker

install: true

stages:
- build-and-test

matrix:
  include:
    - stage: build-and-test
      env: fedora=latest
    - stage: build-and-test
      env: centos=8
    - stage: build-and-test
      env: centos=centos7

before_script:
- if test -n "$fedora" ; then sed -i "s#^FROM.*#FROM registry.fedoraproject.org/fedora:$fedora#" tests/Dockerfile ; fi
- if test -n "$centos" ; then sed -i "s#^FROM.*#FROM centos:$centos#" tests/Dockerfile ; fi

script:
- if grep -q fedora tests/Dockerfile ; then sed -i 's/^RUN/# RUN/; s%^ENTRYPOINT .*%ENTRYPOINT [ "/usr/bin/sleep", "600" ]%' tests/Dockerfile ; fi
- docker build -t mod_authnz_pam -f tests/Dockerfile .
- docker run $( grep -q fedora tests/Dockerfile && echo --security-opt=seccomp:unconfined ) --name mod_authnz_pam --rm -d mod_authnz_pam
- if grep -q fedora tests/Dockerfile ; then docker exec mod_authnz_pam tests/build.sh ; docker exec mod_authnz_pam tests/config.sh ; fi
- if grep -q fedora tests/Dockerfile ; then docker exec mod_authnz_pam /usr/sbin/httpd -DFOREGROUND ; fi & docker exec mod_authnz_pam tests/run.sh

language: generic
dist: focal
sudo: required

virt: vm
arch: arm64-graviton2
group: edge

services:
- docker

install: true

stages:
- build-and-test

matrix:
  include:
    - stage: build-and-test
      env: fedora=latest
    - stage: build-and-test
      env: centos=8
    - stage: build-and-test
      env: centos=centos7

before_script:
- if test -n "$fedora" ; then sed -i "s#^FROM.*#FROM registry.fedoraproject.org/fedora:$fedora#" tests/Dockerfile ; fi
- if test -n "$centos" ; then sed -i "s#^FROM.*#FROM centos:$centos#" tests/Dockerfile ; fi

script:
- docker build -t mod_authnz_pam -f tests/Dockerfile .
- docker run --name mod_authnz_pam --rm -d mod_authnz_pam
- docker exec mod_authnz_pam tests/run.sh

Revert "Workaround 1897493 / 1900021 -- test on docker with disabled seccomp, we have to move the build steps to docker run."
Revert "Workaround 1897493 / 1900021 -- test on docker with disabled seccomp, we have to move the build steps to docker run."

This reverts commit 63bea6d518f3d5d10384fa1530b805083c0f9478.

The latest dockers have updated seccomp policies.
