From dc1a11dbe1172cfdcfa156ed0cae6f616547c459 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 5 Jul 2019 21:45:50 +0200 Subject: [PATCH] CI: Fix/improve Travis cache handling [skip appveyor] #10422 Via https://github.com/neovim/neovim/pull/10412 * use list, no indirection * use job names * __FOR_TRAVIS_CACHE__ (more descriptive) --- .travis.yml | 64 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index e6b9516b6e..d1a0ab7acd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,46 +47,74 @@ env: - CCACHE_SLOPPINESS=time_macros,file_macro - 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: include: - stage: normal builds + name: clang-asan os: linux compiler: clang-4.0 # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6 - env: > - CLANG_SANITIZER=ASAN_UBSAN - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" - ASAN_SYMBOLIZE=asan_symbolize-4.0 - - os: linux + env: + - CLANG_SANITIZER=ASAN_UBSAN + - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" + - ASAN_SYMBOLIZE=asan_symbolize-4.0 + - *common-job-env + - name: gcc-functionaltest-lua + os: linux compiler: gcc - env: > - FUNCTIONALTEST=functionaltest-lua - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" - - os: linux + env: + - FUNCTIONALTEST=functionaltest-lua + - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" + - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" + - *common-job-env + - name: gcc-32bit + os: linux # Travis creates a cache per compiler. Set a different value here to # store 32-bit dependencies in a separate cache. compiler: gcc - env: BUILD_32BIT=ON - - os: osx + env: + - BUILD_32BIT: ON + - *common-job-env + - name: "OSX: clang" + os: osx compiler: clang osx_image: xcode9.4 # macOS 10.13 - - os: osx + env: *common-job-env + - name: "OSX: gcc" + os: osx compiler: gcc osx_image: xcode9.4 # macOS 10.13 + env: *common-job-env - if: branch = master + name: lint os: linux - env: CI_TARGET=lint + env: + - CI_TARGET=lint + - *common-job-env + - stage: Flaky builds + name: gcc-coverage os: linux compiler: gcc - env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" + env: + - GCOV=gcov + - CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" + - *common-job-env - os: linux + name: clang-tsan compiler: clang - env: CLANG_SANITIZER=TSAN + env: + - CLANG_SANITIZER=TSAN + - *common-job-env allow_failures: - - env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" - - env: CLANG_SANITIZER=TSAN + - name: gcc-coverage + - name: clang-tsan fast_finish: true before_install: ci/before_install.sh