blob: 320fb5cee73aa4b13636edebbfb829d9a10e4360 [file] [log] [blame]
# Copyright (c) 2017-2020 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
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
compiler: clang
- os: linux
env: DISTRO=centos:7 TREE=out
compiler: gcc
- os: linux
env: DISTRO=debian:testing
compiler: gcc
- os: linux
env: DISTRO=debian:oldstable
compiler: clang
- os: linux
env: DISTRO=opensuse/tumbleweed CONTAINER=podman CONTAINER_ARGS="--runtime=/usr/bin/runc"
compiler: gcc
- os: linux
env: DISTRO=opensuse/leap
compiler: gcc
- os: linux
env: DISTRO=debian:oldstable
compiler: gcc
- os: linux
env: DISTRO=debian:testing
compiler: clang
- os: linux
env: DISTRO=ubuntu:groovy TREE=out
compiler: gcc
- os: linux
env: DISTRO=ubuntu:xenial
compiler: gcc
- os: linux
env: DISTRO=centos:latest
compiler: gcc
before_install:
# Tumbleweed requires podman and newest runc due docker incompatible with glibc 2.33 (faccessat2)
- CONTAINER="${CONTAINER:-docker}"
- >
if [ "$CONTAINER" = "podman" ]; then
# podman
. /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 [ ! "$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 && ../build.sh -o $TREE -t $BUILD -c $CC $INSTALL_OPT"