Add Travis CI tests for Arch, Debian and OSX/macOS

+ Arch and Debian are run in Docker containers, as openSUSE Tumbleweed.

+ OSX/macOS doesn't use any containers.
   * Homebrew is used to fetch all the dependencies.
   * The dependencies are declared in the Brewfile.travis file.

+ The travis-build.sh script has been modified to check for the current
  OS and the different configure flags has been moved into an array
  that'll be looped through instead.
  The xscreensaver (for libXScrnSaver) flags has been removed for macOS
  as it only makes sense for systems running X11, which macOS doesn't
  (usually) do.

+ Some minor shellcheck fixes, too.

Fixes: #1100
This commit is contained in:
William Wennerström
2019-06-04 13:45:17 +02:00
parent 48013f8d43
commit 3700c80ad1
7 changed files with 244 additions and 140 deletions

View File

@@ -1,10 +1,47 @@
sudo: required
language: c
language: bash
services:
- docker
- docker # Linux tests are run in Docker containers.
addons:
homebrew:
brewfile: Brewfile.travis # mac OS dependencies.
# libsignal-protocol-c is still not in the Travis CI Homebrew snapshot, the
# line below could be removed when the snapshot has been updated to speed up
# the OSX job.
update: true
matrix:
include:
- os: linux
env: BUILD_FLAVOR=tumbleweed
- os: linux
env: BUILD_FLAVOR=debian
- os: linux
env: BUILD_FLAVOR=arch
- os: osx
env:
# Ensure that "keg-only" Homebrew versions are used.
- PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig:$PKG_CONFIG_PATH"
- PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig:$PKG_CONFIG_PATH"
- PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig:$PKG_CONFIG_PATH"
- PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
- PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH"
before_install:
- docker build -f Dockerfile -t profanity .
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
docker build -f Dockerfile."$BUILD_FLAVOR" -t profanity .;
fi
script:
- docker run -it profanity ./travis-build.sh
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
docker run -it profanity ./travis-build.sh;
fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
./travis-build.sh;
fi
after_failure:
- cat ./config.log
- env