2016-11-04 16:41:25 +08:00
|
|
|
sudo: false
|
2016-05-27 01:42:04 +08:00
|
|
|
|
2016-12-07 04:14:55 +08:00
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2018-03-22 04:07:44 +08:00
|
|
|
# Release branches
|
|
|
|
- /^[0-9]+\.[0-9]+$/
|
2016-12-07 04:14:55 +08:00
|
|
|
|
2016-05-31 03:08:25 +08:00
|
|
|
os:
|
|
|
|
- linux
|
|
|
|
- osx
|
|
|
|
|
2016-11-04 16:18:54 +08:00
|
|
|
compiler:
|
|
|
|
- gcc
|
|
|
|
- clang
|
|
|
|
|
2016-11-04 16:22:32 +08:00
|
|
|
env:
|
|
|
|
- MESON_ARGS=""
|
2019-07-09 02:02:05 +08:00
|
|
|
- RUN_TESTS_ARGS="--no-unittests" MESON_ARGS="--unity=on"
|
2016-11-04 16:22:32 +08:00
|
|
|
|
2016-05-31 03:08:25 +08:00
|
|
|
language:
|
|
|
|
- cpp
|
2016-05-27 01:44:32 +08:00
|
|
|
|
2016-05-27 01:42:04 +08:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
2016-11-08 18:38:50 +08:00
|
|
|
matrix:
|
|
|
|
exclude:
|
|
|
|
# On OS X gcc is just a wrapper around clang, so don't waste time testing that
|
|
|
|
- os: osx
|
|
|
|
compiler: gcc
|
2018-05-27 03:59:11 +08:00
|
|
|
include:
|
|
|
|
# Test cross builds separately, they do not use the global compiler
|
|
|
|
- os: linux
|
|
|
|
compiler: gcc
|
2018-06-10 02:14:21 +08:00
|
|
|
env: RUN_TESTS_ARGS="--cross"
|
2018-05-27 03:59:11 +08:00
|
|
|
- os: linux
|
|
|
|
compiler: gcc
|
2018-06-10 02:14:21 +08:00
|
|
|
env: RUN_TESTS_ARGS="--cross" MESON_ARGS="--unity=on"
|
2016-11-08 18:38:50 +08:00
|
|
|
|
2016-05-27 01:42:04 +08:00
|
|
|
before_install:
|
2018-03-23 06:32:35 +08:00
|
|
|
- python ./skip_ci.py --base-branch-env=TRAVIS_BRANCH --is-pull-env=TRAVIS_PULL_REQUEST
|
2016-05-31 03:08:25 +08:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
2019-08-29 18:37:03 +08:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt llvm ninja; fi
|
2018-08-20 03:15:52 +08:00
|
|
|
# # Run one macOS build without pkg-config available, and the other (unity=on) with pkg-config
|
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$MESON_ARGS" =~ .*unity=on.* ]]; then brew install pkg-config; fi
|
2019-10-20 02:52:59 +08:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull jpakkane/mesonci:eoan; fi
|
2016-05-27 01:42:04 +08:00
|
|
|
|
2016-05-31 03:08:25 +08:00
|
|
|
# We need to copy the current checkout inside the Docker container,
|
2016-05-29 03:45:13 +08:00
|
|
|
# because it has the MR id to be tested checked out.
|
|
|
|
|
2016-05-27 01:42:04 +08:00
|
|
|
script:
|
2019-10-20 02:52:59 +08:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM jpakkane/mesonci:eoan > Dockerfile; fi
|
2016-05-31 03:08:25 +08:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
|
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
|
2017-05-07 15:22:36 +08:00
|
|
|
- |
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
ci_env=`bash <(curl -s https://codecov.io/env)`
|
2019-07-25 03:17:00 +08:00
|
|
|
docker run --security-opt seccomp:unconfined $ci_env -v ${PWD}/.coverage:/root/.coverage \
|
2017-05-07 15:22:36 +08:00
|
|
|
withgit \
|
2019-08-30 06:18:20 +08:00
|
|
|
/bin/sh -c "cd /root && mkdir -p tools; wget -c https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip -O /root/tools/ninja.zip; unzip -d /root/tools /root/tools/ninja.zip; chmod +x /root/tools/ninja; CC=$CC CXX=$CXX OBJC=$CC OBJCXX=$CXX PATH=/root/tools:$PATH ./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS && chmod -R a+rwX .coverage"
|
2017-05-07 15:22:36 +08:00
|
|
|
fi
|
2018-09-26 00:38:55 +08:00
|
|
|
# Ensure that llvm is added after $PATH, otherwise the clang from that llvm install will be used instead of the native apple clang.
|
2019-08-29 18:37:03 +08:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib OBJC=$CC OBJCXX=$CXX PATH=$HOME/tools:/usr/local/opt/qt/bin:$PATH:$(brew --prefix llvm)/bin ./run_tests.py $RUN_TESTS_ARGS --backend=ninja -- $MESON_ARGS ; fi
|