travis: add many additional builds

This commit is contained in:
Evan Nemerson 2016-06-28 20:35:16 -07:00
parent 3e33d7636a
commit 37be4e37ce
4 changed files with 272 additions and 67 deletions

46
.travis.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
case "$1" in
"install")
case "${TRAVIS_OS_NAME}" in
"osx")
brew update
brew install binutils
case "${CC}" in
"gcc-"*)
which ${CC} || brew install homebrew/versions/gcc$(echo "${CC#*-}" | sed 's/\.//')
;;
esac
case "${BUILD_SYSTEM}" in
"python")
source terryfy/travis_tools.sh
get_python_environment $INSTALL_TYPE $PYTHON_VERSION venv
pip install --upgrade wheel
;;
esac
;;
esac
;;
"script")
case "${BUILD_SYSTEM}" in
"cmake")
mkdir builddir && cd builddir
cmake -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DENABLE_SANITIZER="${SANITIZER}" ..
make VERBOSE=1
make test
;;
"python")
python setup.py build_ext test
;;
esac
;;
"after_success")
case "${BUILD_SYSTEM}" in
"python")
pip wheel -w dist .
;;
esac
;;
esac

View File

@ -1,42 +1,230 @@
language: c
dist: trusty
os:
- linux
- osx
env:
matrix:
- BUILD_SYSTEM='python' INSTALL_TYPE='system' PYTHON_VERSION=2.7
- BUILD_SYSTEM='python' INSTALL_TYPE='macpython' PYTHON_VERSION=2.7.10 CC=clang CXX=clang++
- BUILD_SYSTEM='python' INSTALL_TYPE='macpython' PYTHON_VERSION=3.4.3 CC=clang CXX=clang++
- BUILD_SYSTEM='python' INSTALL_TYPE='macpython' PYTHON_VERSION=3.5.0 CC=clang CXX=clang++
- BUILD_SYSTEM='python' INSTALL_TYPE='homebrew' PYTHON_VERSION=2.7.10
- BUILD_SYSTEM='python' INSTALL_TYPE='homebrew' PYTHON_VERSION=3.4.3
- BUILD_SYSTEM='python' INSTALL_TYPE='homebrew' PYTHON_VERSION=3.5.0
- BUILD_SYSTEM='cmake' CC=gcc CXX=g++
- BUILD_SYSTEM='cmake' CC=clang CXX=clang++
matrix:
exclude:
- os: linux
env: BUILD_SYSTEM='python' INSTALL_TYPE='macpython' PYTHON_VERSION=2.7.10 CC=clang CXX=clang++
- os: linux
env: BUILD_SYSTEM='python' INSTALL_TYPE='macpython' PYTHON_VERSION=3.4.3 CC=clang CXX=clang++
- os: linux
env: BUILD_SYSTEM='python' INSTALL_TYPE='macpython' PYTHON_VERSION=3.5.0 CC=clang CXX=clang++
- os: linux
env: BUILD_SYSTEM='python' INSTALL_TYPE='homebrew' PYTHON_VERSION=2.7.10
- os: linux
env: BUILD_SYSTEM='python' INSTALL_TYPE='homebrew' PYTHON_VERSION=3.4.3
- os: linux
env: BUILD_SYSTEM='python' INSTALL_TYPE='homebrew' PYTHON_VERSION=3.5.0
include:
###
## Linux builds using various versions of GCC.
###
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-6 CXX_COMPILER=g++-6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-5 CXX_COMPILER=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.9 CXX_COMPILER=g++-4.9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.8 CXX_COMPILER=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.7 CXX_COMPILER=g++-4.7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.7
- g++-4.7
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.6 CXX_COMPILER=g++-4.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.6
- g++-4.6
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.5 CXX_COMPILER=g++-4.5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.5
- g++-4.5
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.4 CXX_COMPILER=g++-4.4
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.4
- g++-4.4
###
## clang 3.5-3.8 are currently disabled. LLVM's repo was down for
## a while, so Travis disabled the repository. LLVM's apt repos
## are back up, but Travis has yet to re-enable them. For
## details, see
## https://github.com/travis-ci/apt-source-whitelist/issues/279
###
# - os: linux
# env: BUILD_SYSTEM=cmake C_COMPILER=clang-3.8 CXX_COMPILER=clang++-3.8
# addons:
# apt:
# sources:
# - llvm-toolchain-precise-3.8
# packages:
# - clang-3.8
# - clang-3.8
# - os: linux
# env: BUILD_SYSTEM=cmake C_COMPILER=clang-3.7 CXX_COMPILER=clang++-3.7
# addons:
# apt:
# sources:
# - llvm-toolchain-precise-3.7
# packages:
# - clang-3.7
# - clang-3.7
# - os: linux
# env: BUILD_SYSTEM=cmake C_COMPILER=clang-3.6 CXX_COMPILER=clang++-3.6
# addons:
# apt:
# sources:
# - llvm-toolchain-precise-3.6
# packages:
# - clang-3.6
# - clang-3.6
# - os: linux
# env: BUILD_SYSTEM=cmake C_COMPILER=clang-3.5 CXX_COMPILER=clang++-3.5
# addons:
# apt:
# sources:
# - llvm-toolchain-precise-3.5
# packages:
# - clang-3.5
# - clang-3.5
###
## clang/clang++ on 12.04 is 3.4
###
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=clang CXX_COMPILER=clang++
###
## Python build on Linux
###
- os: linux
env: BUILD_SYSTEM=python C_COMPILER=gcc-6 CXX_COMPILER=g++-6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
###
## CMake on OS X
##
## These all work, but it seems unnecessary to actually build them
## all since we already test all these versions of GCC on Linux.
## We'll just test 4.4 and the most recent version.
###
- os: osx
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-6 CXX_COMPILER=g++-6
# - os: osx
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-5 CXX_COMPILER=g++-5
# - os: osx
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.9 CXX_COMPILER=g++-4.9
# - os: osx
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.8 CXX_COMPILER=g++-4.8
# - os: osx
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.7 CXX_COMPILER=g++-4.7
# - os: osx
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.6 CXX_COMPILER=g++-4.6
# - os: osx
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.5 CXX_COMPILER=g++-4.5
- os: osx
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.4 CXX_COMPILER=g++-4.4
###
## Python OS X builds
###
- os: osx
env: BUILD_SYSTEM=python INSTALL_TYPE=system PYTHON_VERSION=2.7
- os: osx
env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=2.7.10
- os: osx
env: BUILD_SYSTEM=python INSTALL_TYPE=homebrew PYTHON_VERSION=2.7.10
- os: osx
env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=3.4.3
- os: osx
env: BUILD_SYSTEM=python INSTALL_TYPE=homebrew PYTHON_VERSION=3.4.3
- os: osx
env: BUILD_SYSTEM=python INSTALL_TYPE=macpython PYTHON_VERSION=3.5.0
- os: osx
env: BUILD_SYSTEM=python INSTALL_TYPE=homebrew PYTHON_VERSION=3.5.0
###
## Sanitizers
##
## There is a bug in the current Ubuntu 12.04 packages (from the
## ubuntu-toolchain-r-test repository) which causes an error when
## linking when using a sanitizer. Once that issue is resolved,
## these can be enabled. Unfortunately, the ubuntu-toolchain-r
## repository doesn't allow bug reports, so there is no way to
## track the issue (or even know if they are aware of it).
###
# - os: linux
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-6 CXX_COMPILER=g++-6 SANITIZER=address
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - gcc-6
# - g++-6
# - os: linux
# env: BUILD_SYSTEM=cmake C_COMPILER=gcc-6 CXX_COMPILER=g++-6 SANITIZER=thread
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - gcc-6
# - g++-6
before_install:
###
## If we use the matrix to set CC/CXX, Travis overwrites the values,
## so instead we use C/CXX_COMPILER, then copy the values to CC/CXX
## here (after Travis has set CC/CXX).
###
- if [ -n "${C_COMPILER}" ]; then export CC="${C_COMPILER}"; fi
- if [ -n "${CXX_COMPILER}" ]; then export CXX="${CXX_COMPILER}"; fi
install:
- ./buildfiles/.travis.sh install
- ./.travis.sh install
script:
- ./buildfiles/.travis.sh script
- ./.travis.sh script
after_success:
- ./buildfiles/.travis.sh after_success
- ./.travis.sh after_success
before_deploy:
- if [ "${BUILD_SYSTEM}" = "python" ]; then export WHEELS=$(ls ./dist/*.whl); fi

View File

@ -32,6 +32,12 @@ string(REGEX REPLACE "^#define BROTLI_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\"
string(REGEX REPLACE "^#define BROTLI_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\"$" "\\3" BROTLI_VERSION_REVISION "${BROTLI_VERSION}")
mark_as_advanced(BROTLI_VERSION_MAJOR BROTLI_VERSION_MINOR BROTLI_VERSION_REVISION)
if (ENABLE_SANITIZER)
set(CMAKE_C_FLAGS " ${CMAKE_C_FLAGS} -fsanitize=${ENABLE_SANITIZER}")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -fsanitize=${ENABLE_SANITIZER}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${ENABLE_SANITIZER}")
endif ()
set(BROTLI_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")
set(BROTLI_LIBRARIES brotli_enc brotli_dec brotli_common m)
mark_as_advanced(BROTLI_INCLUDE_DIRS BROTLI_LIBRARIES)

View File

@ -1,35 +0,0 @@
#!/bin/sh -x
OPERATION="$1"
case "${BUILD_SYSTEM}" in
"cmake")
case "${OPERATION}" in
"script")
mkdir builddir && cd builddir
cmake -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" ..
make VERBOSE=1
make test
;;
esac
;;
"python")
case "${OPERATION}" in
"install")
if [ $TRAVIS_OS_NAME = "osx" ]; then
source terryfy/travis_tools.sh
get_python_environment $INSTALL_TYPE $PYTHON_VERSION venv
pip install --upgrade wheel
else
pip install --user --upgrade wheel
fi
;;
"script")
python setup.py build_ext test
;;
"after_success")
pip wheel -w dist .
;;
esac
;;
esac