ci: fix/improve Travis cache handling [skip appveyor] (#10412)

This is meant to not fall back to using the cache for the "master"
target branch, for release pull requests (targeting not "master").

(Travis builds the cache key based on all (explicit) job environment
variables)
This commit is contained in:
Daniel Hahler 2019-07-07 18:07:01 +02:00 committed by GitHub
parent b53c483a4a
commit 38342d75f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,47 +47,76 @@ env:
- CCACHE_SLOPPINESS=time_macros,file_macro - CCACHE_SLOPPINESS=time_macros,file_macro
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR" - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
anchors:
envs: &common-job-env
# Do not fall back to cache for "master" for PR on "release" branch:
# adds the target branch to the cache key.
FOR_TRAVIS_CACHE=$TRAVIS_BRANCH
jobs: jobs:
include: include:
- stage: baseline - stage: baseline
name: clang-asan
os: linux os: linux
compiler: clang-4.0 compiler: clang-4.0
# Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6 # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
env: > env:
CLANG_SANITIZER=ASAN_UBSAN - CLANG_SANITIZER=ASAN_UBSAN
CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
ASAN_SYMBOLIZE=asan_symbolize-4.0 - ASAN_SYMBOLIZE=asan_symbolize-4.0
- os: linux - *common-job-env
- name: gcc-functionaltest-lua
os: linux
compiler: gcc compiler: gcc
env: > env:
FUNCTIONALTEST=functionaltest-lua - FUNCTIONALTEST=functionaltest-lua
CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
- os: linux - *common-job-env
- name: gcc-32bit
os: linux
# Travis creates a cache per compiler. Set a different value here to # Travis creates a cache per compiler. Set a different value here to
# store 32-bit dependencies in a separate cache. # store 32-bit dependencies in a separate cache.
compiler: gcc compiler: gcc
env: BUILD_32BIT=ON env:
- BUILD_32BIT=ON
- *common-job-env
- if: branch = master AND commit_message !~ /\[skip.lint\]/ - if: branch = master AND commit_message !~ /\[skip.lint\]/
name: lint
os: linux os: linux
env: CI_TARGET=lint env:
- CI_TARGET=lint
- *common-job-env
- stage: second stage - stage: second stage
name: "macOS: clang"
os: osx os: osx
compiler: clang compiler: clang
osx_image: xcode10.2 # macOS 10.14 osx_image: xcode10.2 # macOS 10.14
- os: osx env:
- *common-job-env
- name: "macOS: gcc"
os: osx
compiler: gcc compiler: gcc
osx_image: xcode10.2 # macOS 10.14 osx_image: xcode10.2 # macOS 10.14
env:
- *common-job-env
- os: linux - name: gcc-coverage
os: linux
compiler: gcc compiler: gcc
env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" env:
- os: linux - GCOV=gcov
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- *common-job-env
- name: clang-tsan
os: linux
compiler: clang compiler: clang
env: CLANG_SANITIZER=TSAN env:
- CLANG_SANITIZER=TSAN
- *common-job-env
allow_failures: allow_failures:
- env: CLANG_SANITIZER=TSAN - name: clang-tsan
fast_finish: true fast_finish: true
before_install: ci/before_install.sh before_install: ci/before_install.sh