blob: 5d759dab404549a5c113fb5849833e55d6fc20fb [file] [log] [blame]
# Copyright (c) 2017-2021 Petr Vorel <pvorel@suse.cz>
dist: bionic
sudo: required
language: c
services:
- docker
matrix:
include:
# 32 bit build
- os: linux
env: DISTRO=debian:stable VARIANT=i386
compiler: gcc
# cross compilation builds
- os: linux
env: DISTRO=debian:stable VARIANT=cross-compile ARCH=ppc64el TREE=out MAKE_INSTALL=1
compiler: powerpc64le-linux-gnu-gcc
- os: linux
env: DISTRO=debian:stable VARIANT=cross-compile ARCH=arm64 TREE=out
compiler: aarch64-linux-gnu-gcc
- os: linux
env: DISTRO=debian:stable VARIANT=cross-compile ARCH=s390x TREE=out
compiler: s390x-linux-gnu-gcc
# musl (native)
- os: linux
# Message: WARNING: xsltproc: cannot process http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
# doc/meson.build:70:1: ERROR: Problem encountered: Docs cannot be built: xsltproc does not work correctly
env: DISTRO=alpine:latest METADATA=asciidoctor
compiler: gcc
# build with minimal dependencies
- os: linux
env: DISTRO=debian:stable VARIANT=minimal TREE=out
compiler: clang
# other builds
- os: linux
env: DISTRO=fedora:latest MAKE_INSTALL=1 CONTAINER=podman METADATA=asciidoctor-pdf
compiler: clang
- os: linux
env: DISTRO=centos:7 TREE=out METADATA=asciidoc-pdf
compiler: gcc
- os: linux
env: DISTRO=debian:testing METADATA=asciidoctor-pdf
compiler: gcc
- os: linux
env: DISTRO=debian:oldstable METADATA=asciidoc-pdf
compiler: clang
- os: linux
env: DISTRO=opensuse/tumbleweed CONTAINER=podman METADATA=asciidoctor
compiler: gcc
- os: linux
env: DISTRO=opensuse/leap METADATA=asciidoc-pdf
compiler: gcc
- os: linux
env: DISTRO=debian:oldstable METADATA=asciidoctor
compiler: gcc
- os: linux
env: DISTRO=debian:testing METADATA=asciidoc-pdf
compiler: clang
- os: linux
env: DISTRO=ubuntu:groovy TREE=out METADATA=asciidoctor
compiler: gcc
- os: linux
env: DISTRO=ubuntu:xenial METADATA=asciidoc-pdf
compiler: gcc
- os: linux
env: DISTRO=centos:latest METADATA=asciidoctor
compiler: gcc
before_install:
- CONTAINER="${CONTAINER:-docker}"
# distros with glibc >=2.33 require podman and newest runc due docker faccessat2 incompatibility
- >
if [ "$CONTAINER" = "podman" ]; then
# podman
CONTAINER_ARGS="--runtime=/usr/bin/runc"
. /etc/os-release
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | sudo apt-key add -
sudo apt update
sudo apt -y install podman slirp4netns
# runc
sudo curl -L https://github.com/opencontainers/runc/releases/download/v1.0.0-rc93/runc.amd64 -o /usr/bin/runc
sudo chmod +x /usr/bin/runc
fi
# Docker Hub pull rate limit workaround for docker
- >
if [ "$CONTAINER" = "docker" ]; then
conf="/etc/docker/daemon.json"
tmp=$(mktemp)
sudo jq '."registry-mirrors" += ["https://mirror.gcr.io"]' $conf > $tmp
sudo mv $tmp $conf
sudo systemctl daemon-reload
sudo systemctl restart docker
fi
- $CONTAINER info
# ltp
- DIR="/usr/src/ltp"
- printf "FROM $DISTRO\nRUN mkdir -p $DIR\nWORKDIR $DIR\nCOPY . $DIR\n" > Dockerfile
- cat Dockerfile
- $CONTAINER build $CONTAINER_ARGS -t ltp .
script:
- INSTALL="${DISTRO%%:*}"
- INSTALL="${INSTALL%%/*}"
- if [ "$MAKE_INSTALL" = 1 ]; then INSTALL_OPT="-i"; fi
- if [ "$METADATA" = "asciidoc-pdf" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoc --enable-metadata-pdf"; fi
- if [ "$METADATA" = "asciidoctor" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoctor"; fi
- if [ "$METADATA" = "asciidoctor-pdf" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoctor --enable-metadata-pdf"; fi
- if [ ! "$TREE" ]; then TREE="in"; fi
- case $VARIANT in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
- $CONTAINER run $CONTAINER_ARGS -t ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ARCH=\"$ARCH\" ./$INSTALL.$VARIANT.sh; fi && CONFIGURE_OPT_EXTRA=\"$CONFIGURE_OPT_EXTRA\" ../build.sh -o $TREE -t $BUILD -c $CC $INSTALL_OPT"