Permalink
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (82 sloc) 3.85 KB
sudo: required
language: c
# Get full repo to correctly determine tags from commits
git:
depth: false
# Use docker to test builds on different Linux distros.
# Latest stable image of each distro is pulled to test builds.
matrix:
include:
# https://hub.docker.com/_/fedora/
- os: linux
compiler: gcc
env:
- DISTRO_TYPE=fedora
INSTALL_REQUIREMENTS="dnf repolist; dnf install -y gcc python3 meson sudo langpacks-zh_CN ed ncurses vi findutils which nmap-ncat expect git"
before_install:
- docker pull ${DISTRO_TYPE}
# https://hub.docker.com/_/opensuse/
# Note: Meson 0.44.0 is the newest version that works with Python
# 3.4 available on OpenSuse Leap. See issue #430.
- os: linux
compiler: gcc
env:
- DISTRO_TYPE=opensuse
INSTALL_REQUIREMENTS="zypper refresh; zypper in -y gcc python3 python3-pip ninja sudo glibc-locale glibc-devel ed ncurses-utils vim findutils which netcat expect git; pip3 install meson==0.44.0"
before_install:
- docker pull ${DISTRO_TYPE}
# https://hub.docker.com/_/ubuntu/
# Ubuntu requires explicitly generating en_US.UTF-8 locale
- os: linux
compiler: gcc
env:
- DISTRO_TYPE=ubuntu
INSTALL_REQUIREMENTS="apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc python3 sudo locales ed vim python3-pip ninja-build findutils debianutils netcat-openbsd expect git; pip3 install meson==0.44.0; locale-gen en_US.UTF-8"
before_install:
- docker pull ${DISTRO_TYPE}
# https://hub.docker.com/_/debian/
# Debian requires explicitly generating en_US.UTF-8 locale too
- os: linux
compiler: gcc
env:
- DISTRO_TYPE=debian
INSTALL_REQUIREMENTS="apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc python3 python3-pip ninja-build sudo locales ed vim procps findutils debianutils netcat-openbsd expect git; pip3 install meson==0.44.0; sed -i '/# en_US.UTF-8 UTF-8/s/..//' /etc/locale.gen && locale-gen"
before_install:
- docker pull ${DISTRO_TYPE}
# https://hub.docker.com/r/i386/ubuntu/
# 32-bit environment
# i686 images are built officially by docker but not supported
# https://github.com/docker-library/official-images#architectures-other-than-amd64
- os: linux
compiler: gcc
env:
- DISTRO_TYPE=i386/ubuntu
INSTALL_REQUIREMENTS="apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc python3 sudo locales ed vim python3-pip ninja-build findutils debianutils netcat-openbsd expect git; pip3 install meson==0.44.0; locale-gen en_US.UTF-8"
before_install:
- docker pull ${DISTRO_TYPE}
- os: osx
compiler: clang
before_install:
- brew update
env:
# This variable is not required by macOS builds, but setting it for Travis dashboard.
- DISTRO_TYPE=macOS
- os: linux
env:
- SCAN_TYPE="shellcheck"
DISTRO_TYPE=fedora
INSTALL_REQUIREMENTS="dnf repolist; dnf install -y shellcheck"
before_install:
- docker pull ${DISTRO_TYPE}
services:
- docker
script:
# Fetch tags to set version number
- git fetch --tags
- if [[ $SCAN_TYPE == "shellcheck" ]]; then exec bin/shellcheck; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then exec scripts/build-on-macos.sh; fi
- docker run -v $TRAVIS_BUILD_DIR:/source ${DISTRO_TYPE} bash -c "set -e;
${INSTALL_REQUIREMENTS};
useradd --create-home test;
chown -R test /source;
sudo -u test /source/scripts/build-on-docker.sh '${DISTRO_TYPE}'"