Attempt to make Travis-CI work
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
This commit is contained in:
parent
d8dc70c2fd
commit
d0e59844e4
1 changed files with 50 additions and 68 deletions
110
.travis.yml
110
.travis.yml
|
@ -5,9 +5,6 @@ git:
|
||||||
# No need for sudo
|
# No need for sudo
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
# Use linux unless specified otherwise
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
# Bionic is the most recent version of Ubuntu I can get to work properly
|
# Bionic is the most recent version of Ubuntu I can get to work properly
|
||||||
dist: bionic
|
dist: bionic
|
||||||
|
|
||||||
|
@ -17,53 +14,37 @@ language: cpp
|
||||||
# Cache compiled object files with ccache
|
# Cache compiled object files with ccache
|
||||||
cache: ccache
|
cache: ccache
|
||||||
|
|
||||||
# Matrix for configuring all the build configurations
|
osx_image: xcode11.2
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
# Clang on OSX
|
|
||||||
- env: COMPILER=clang++ BUILD_TYPE=Debug
|
|
||||||
os: osx
|
|
||||||
osx_image: xcode11.2
|
|
||||||
compiler: clang
|
|
||||||
name: OSX Clang Debug
|
|
||||||
|
|
||||||
- env: COMPILER=clang++ BUILD_TYPE=Release
|
compiler:
|
||||||
os: osx
|
- gcc
|
||||||
osx_image: xcode11.2
|
- clang
|
||||||
compiler: clang
|
|
||||||
name: OSX Clang Release
|
|
||||||
|
|
||||||
# TODO add gcc from https://docs.travis-ci.com/user/languages/cpp/#gcc-on-macos
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
|
|
||||||
# Clang on Linux
|
addons:
|
||||||
- env: COMPILER=clang++-9 BUILD_TYPE=Debug
|
|
||||||
addons: &clang80
|
|
||||||
apt:
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
||||||
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
|
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||||
packages:
|
packages:
|
||||||
- clang-9
|
- clang-9
|
||||||
sources:
|
- cmake
|
||||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
- gcc-9
|
||||||
- sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
|
||||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
|
||||||
name: Linux Clang Debug
|
|
||||||
|
|
||||||
- env: COMPILER=clang++-9 BUILD_TYPE=Release
|
|
||||||
addons: *clang80
|
|
||||||
name: Linux Clang Release
|
|
||||||
|
|
||||||
# GCC on Linux
|
|
||||||
- env: COMPILER=g++-9 BUILD_TYPE=Debug
|
|
||||||
addons: &gcc9
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-9
|
- g++-9
|
||||||
sources:
|
homebrew:
|
||||||
- ubuntu-toolchain-r-test
|
packages:
|
||||||
name: Linux GCC Debug
|
- cmake
|
||||||
|
- gcc@9
|
||||||
|
- llvm@9
|
||||||
|
update: true
|
||||||
|
|
||||||
- env: COMPILER=g++-9 BUILD_TYPE=Release
|
env:
|
||||||
addons: *gcc9
|
- BUILD_TYPE=Debug
|
||||||
name: Linux GCC Release
|
- BUILD_TYPE=RelWithDebInfo
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# Display available disk space
|
# Display available disk space
|
||||||
|
@ -75,13 +56,31 @@ before_install:
|
||||||
# Display build type
|
# Display build type
|
||||||
- echo $BUILD_TYPE
|
- echo $BUILD_TYPE
|
||||||
|
|
||||||
install:
|
# The following Homebrew packages aren't linked by default, and need to be prepended to the path explicitly.
|
||||||
# Set ${CXX} properly
|
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||||
- export CXX=${COMPILER}
|
export PATH="$(brew --prefix llvm)/bin:$PATH";
|
||||||
|
fi
|
||||||
|
|
||||||
# Display compiler version
|
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
|
||||||
|
- if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
|
||||||
|
|
||||||
|
# /usr/bin/clang points to an older compiler on both Linux and macOS.
|
||||||
|
#
|
||||||
|
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
|
||||||
|
# below don't work on macOS. Fortunately, the path change above makes the
|
||||||
|
# default values (clang and clang++) resolve to the correct compiler on macOS.
|
||||||
|
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||||
|
if [ "$CXX" = "clang++" ]; then export CXX="clang++-9" CC="clang-9"; fi;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Display compilers/cmake name/version
|
||||||
|
- echo ${CC}
|
||||||
|
- echo ${CXX}
|
||||||
|
- ${CC} --version
|
||||||
- ${CXX} --version
|
- ${CXX} --version
|
||||||
|
- cmake --version
|
||||||
|
|
||||||
|
install:
|
||||||
# Get number of cores (or 2 by default if somehow none of these are available somehow)
|
# Get number of cores (or 2 by default if somehow none of these are available somehow)
|
||||||
- JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2)
|
- JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2)
|
||||||
- echo $JOBS
|
- echo $JOBS
|
||||||
|
@ -93,30 +92,13 @@ install:
|
||||||
- |
|
- |
|
||||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||||
# This is OSX
|
# This is OSX
|
||||||
brew install ccache || brew upgrade cmake
|
brew install ccache
|
||||||
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install required libraries
|
# Install required libraries
|
||||||
- mkdir travisLibs && cd travisLibs
|
- mkdir travisLibs && cd travisLibs
|
||||||
|
|
||||||
# Install modern CMake
|
|
||||||
- CMAKE_VERSION=3.14.5
|
|
||||||
- |
|
|
||||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
|
||||||
# This is Linux
|
|
||||||
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
|
|
||||||
CMAKE_DIR=cmakeDownload
|
|
||||||
mkdir ${CMAKE_DIR} && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR}
|
|
||||||
export PATH=${PWD}/${CMAKE_DIR}/bin:${PATH}
|
|
||||||
else
|
|
||||||
# This is OSX
|
|
||||||
brew install cmake || brew upgrade cmake
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Display CMake version
|
|
||||||
- cmake --version
|
|
||||||
|
|
||||||
# Install modern SDL2
|
# Install modern SDL2
|
||||||
- SDL2_VERSION=2.0.10
|
- SDL2_VERSION=2.0.10
|
||||||
- |
|
- |
|
||||||
|
|
Loading…
Add table
Reference in a new issue