Skip to content

Commit

Permalink
Adjust coverage of Travis builds (#30768)
Browse files Browse the repository at this point in the history
* Adjust coverage of Travis builds


Attempt to get in all the configurations we really care about in PR tests.
Max and Min versions of supported compilers.
A mix of Curses and Tiles/Sound builds.
A mix of Make and CMake builds.
Localization disabled.
The most popular (Tiles/Sound) Mac and Windows builds.
Address sanitization enabled on latest GCC and Clang.
Clang-tidy build.

Finally, round out all the remaining supported compiler versions only on master builds, along with the somewhat obscure Mingw-w64 Terminal build.

* Fix clang 8 install

* Outline travis build target strategy

Taken from #30761

* Add a new build stage
  • Loading branch information
kevingranade authored and ZhilkinSerg committed May 24, 2019
1 parent 164d970 commit 447ad3f
Showing 1 changed file with 57 additions and 54 deletions.
111 changes: 57 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,56 +32,81 @@ branches:
- master
- development

# Overall strategy for what sorts of builds to include:
# We want a build for each compiler and each platform.
# For PRs, we lessen the "each compiler" requirement to just covering the newest
# and oldest relevant version of each compiler.
# We also want to ensure that each of the following tweaks are covered in at
# least one PR build:
# - TILES=1
# - SOUND=1
# - RELEASE=1
# - CMAKE=1
# - SANITIZE=address
# - LOCALIZE=0
# - A clang-tidy run
# We try to minimize the number of builds subject to those constraints.

# To see what toolchains are available, consult the following:
# https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
# https://launchpad.net/%7Eubuntu-toolchain-r/+archive/ubuntu/test/+index

jobs:
include:
# Initial test stage, if this fails everything else is cancelled.
- stage: test
# GCC 5.4 is the pre-installed compiler on Xenial
env: COMPILER=g++ MODS=--mods=RL_Classes TEST_STAGE=1
- stage: Test
# Clang is consistently the fastest to build, so use it for the initial test.
# Clang 3.8, oldest supported Clang, build with Makefile with extra tests and json style check.
env: CLANG=clang++-3.8 MODS=--mods=RL_Classes TEST_STAGE=1 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
compiler: clang
addons: &clang38
apt:
packages: ["clang-3.8", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: *apt_sources

# Then build different configurations and targets in parallel.
- stage: variants
# Linux Tiles
env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough' TILES=1 SOUND=1 SANITIZE=address
- stage: "Main Compilers"
# GCC 5.3, oldest supported GCC, build with Makefile configured for Curses, disable LOCALIZE
env: COMPILER=g++ LOCALIZE=0
compiler: gcc
addons: &gcc53
apt:
packages: ["g++-5=5.3.1-14ubuntu2", "libstdc++-5-dev=5.3.1-14ubuntu2", "gcc-5=5.3.1-14ubuntu2", "gcc-5-base=5.3.1-14ubuntu2", "cpp-5=5.3.1-14ubuntu2", "libgcc-5-dev=5.3.1-14ubuntu2", "libasan2=5.3.1-14ubuntu2", "libmpx0=5.3.1-14ubuntu2"]
sources: [*apt_sources]

# GCC 8, latest supported GCC, build with Makefile configured with TILES and SOUND and use address sanitization
- env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough' TILES=1 SOUND=1 SANITIZE=address
compiler: gcc
addons: &gcc8
apt:
packages: ["g++-8", "g++-8-multilib", "libc6-dbg", "libc6-dbg:i386", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: *apt_sources

# MXE variants using alternate repository http://mirror.mxe.cc/repos/apt
# GCC MinGW
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine'
addons: &gcc
# Clang 8, latest supported Clang, build with Makefile and address sanitization, but disable some very long-running tests
- env: CLANG=clang++-8 SANITIZE=address EXTRA_TEST_OPTS="~[.] ~vehicle_efficiency ~vehicle_drag ~starting_items"
compiler: clang
addons: &clang8
apt:
packages: ["wine"]
packages: ["clang-8", "libc6-dbg", "libc6-dbg:i386"]
sources: [*apt_sources, llvm-toolchain-xenial-8]

# Windows Tiles
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine' TILES=1 SOUND=1
- stage: "Platforms and Tidy"
# MXE variant using alternate repository http://mirror.mxe.cc/repos/apt
# Mingw-w64 building with Tiles and Sound
env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine' TILES=1 SOUND=1
compiler: gcc
addons: &gcc
apt:
packages: ["wine"]

# CMake Clang 6.0 Tiles with CMAKE
- env: CLANG=clang++-6.0 TILES=1 SOUND=1 CXXFLAGS=-Wno-error=unused-command-line-argument CMAKE=1 RELEASE=1
compiler: clang
addons: &clang60
apt:
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-xenial-6.0]

# macOS Tiles
# Xcode 10.1 building with Tiles and sound
- env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1
os: osx
osx_image: xcode10.1
compiler: clang

# CMake Clang 8.0 Tiles with CMAKE and clang-tidy
# Execute Clang-tidy with CMake, configured with Tiles and Sound
# (analysis only; no build or tests)
- env: CLANG=clang++-8 TILES=1 SOUND=1 CXXFLAGS=-Wno-unused-command-line-argument CMAKE=1 CATA_CLANG_TIDY=clang-tidy-8
compiler: clang
Expand All @@ -92,14 +117,9 @@ jobs:

# Finally check the compiler variants
- stage: compilers
# GCC 5.3
# GCC 5.4 is default on Xenial
env: COMPILER=g++
if: type != pull_request
compiler: gcc
addons: &gcc53
apt:
packages: ["g++-5=5.3.1-14ubuntu2", "libstdc++-5-dev=5.3.1-14ubuntu2", "gcc-5=5.3.1-14ubuntu2", "gcc-5-base=5.3.1-14ubuntu2", "cpp-5=5.3.1-14ubuntu2", "libgcc-5-dev=5.3.1-14ubuntu2", "libasan2=5.3.1-14ubuntu2", "libmpx0=5.3.1-14ubuntu2"]
sources: [*apt_sources]

# GCC 6
- env: COMPILER=g++-6
Expand All @@ -110,33 +130,21 @@ jobs:
packages: ["g++-6", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
sources: *apt_sources

# GCC 7
- env: COMPILER=g++-7 CXXFLAGS='-Wno-implicit-fallthrough' CODE_COVERAGE=true
# GCC 7, adding _GLIBCXX_DEBUG so that one build can test with that
- env: COMPILER=g++-7 CXXFLAGS='-Wno-implicit-fallthrough -D_GLIBCXX_DEBUG' CODE_COVERAGE=true
if: type != pull_request
compiler: gcc
addons: &gcc7
apt:
packages: ["g++-7", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386", "lcov"]
sources: *apt_sources

# GCC 8
# Also, adding _GLIBCXX_DEBUG so that one build can test with that
- env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough -D_GLIBCXX_DEBUG'
compiler: gcc
if: type != pull_request
addons: &gcc8
apt:
packages: ["g++-8", "g++-8-multilib", "libc6-dbg"]
sources: *apt_sources

# Clang 3.8
- env: CLANG=clang++-3.8 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
compiler: clang
# GCC MinGW with only terminal support
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine'
if: type != pull_request
addons: &clang38
addons: &gcc
apt:
packages: ["clang-3.8", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: *apt_sources
packages: ["wine"]

# Clang 3.9
- env: CLANG=clang++-3.9 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
Expand Down Expand Up @@ -168,13 +176,13 @@ jobs:
packages: ["clang-5.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: [*apt_sources, llvm-toolchain-trusty-5.0]

# Clang 6.0
- env: CLANG=clang++-6.0
# CMake Clang 6.0 Tiles with CMAKE
- env: CLANG=clang++-6.0 TILES=1 SOUND=1 CXXFLAGS=-Wno-error=unused-command-line-argument CMAKE=1 RELEASE=1
if: type != pull_request
compiler: clang
addons: &clang60
apt:
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-xenial-6.0]

# Clang 7
Expand All @@ -186,11 +194,6 @@ jobs:
packages: ["clang-7", "libc6-dbg", "libc6-dbg:i386"]
sources: [*apt_sources, llvm-toolchain-xenial-7]

# Clang 8
- env: CLANG=clang++-8 SANITIZE=address EXTRA_TEST_OPTS="~[.] ~vehicle_efficiency ~vehicle_drag ~starting_items"
compiler: clang
addons: *clang8

before_script:
- if [ -n "${CLANG}" ]; then COMPILER="$CLANG"; fi
- ${COMPILER} --version
Expand Down

0 comments on commit 447ad3f

Please sign in to comment.