addons: apt: packages: - libgl1-mesa-dev - g++-4.8 - ninja-build - lcov - libsdl2-dev - libglfw3-dev - libopenal-dev matrix: include: - language: cpp os: linux dist: xenial compiler: gcc env: - JOBID=linux-gl - TARGET=desktop - CMAKE_CXX_FLAGS="--coverage" - LCOV_EXTRA_OPTS="--gcov-tool /usr/bin/gcov-4.8" - language: cpp os: linux dist: xenial compiler: gcc env: - JOBID=linux-nondeprecated - TARGET=desktop - BUILD_DEPRECATED=OFF - language: cpp os: linux dist: xenial compiler: clang env: - JOBID=linux-sanitizers - TARGET=desktop-sanitizers - CMAKE_CXX_FLAGS=-fsanitize=address addons: apt: sources: - llvm-toolchain-xenial packages: - libgl1-mesa-dev - ninja-build - clang-3.8 - libsdl2-dev - libglfw3-dev - libopenal-dev - language: cpp os: linux dist: xenial compiler: gcc env: - JOBID=linux-vulkan - TARGET=desktop-vulkan - CMAKE_CXX_FLAGS="--coverage" addons: apt: packages: - ninja-build - lcov - libsdl2-dev - libglfw3-dev - language: cpp os: linux dist: xenial compiler: gcc env: - JOBID=linux-static - TARGET=desktop - CMAKE_CXX_FLAGS="--coverage" - LCOV_EXTRA_OPTS="--gcov-tool /usr/bin/gcov-4.8" - BUILD_STATIC=ON - language: cpp os: linux dist: xenial compiler: gcc env: - JOBID=linux-gles2 - TARGET=desktop-gles - TARGET_GLES2=ON - CMAKE_CXX_FLAGS="--coverage" - LCOV_EXTRA_OPTS="--gcov-tool /usr/bin/gcov-4.8" - language: cpp os: linux dist: xenial compiler: gcc env: - JOBID=linux-gles3 - TARGET=desktop-gles - TARGET_GLES2=OFF - CMAKE_CXX_FLAGS="--coverage" - LCOV_EXTRA_OPTS="--gcov-tool /usr/bin/gcov-4.8" - language: cpp os: osx # The new plugin testing workflow is dynamically loading and unloading them # in the tests. When that's combined with coverage and LLVM < 5.0.1, all # such tests crash on exit: https://bugs.llvm.org/show_bug.cgi?id=27224 # But only in some cases (for example not at all in tests for Corrade # PluginManager itself). The commit fixing it is from Jan 3 2018 and all # Xcode versions before Xcode 9.3 beta (released on Jan 24) are affected. # https://github.com/llvm-mirror/compiler-rt/commit/860d7953a6f36980f406bfbff76f3c00f15eed57 # Xcode 9.3 beta has broken git clone ("unknown protocol version 2") since # Feb 16 2019, so using version 9.3 now. osx_image: xcode9.3 compiler: clang env: - JOBID=macos-gl - TARGET=desktop - CMAKE_CXX_FLAGS="--coverage" - language: cpp os: osx # See above osx_image: xcode9.3 compiler: clang env: - JOBID=macos-static - TARGET=desktop - CMAKE_CXX_FLAGS="--coverage" - BUILD_STATIC=ON - language: cpp os: osx osx_image: xcode7.3 env: - JOBID=ios-gles2 - TARGET=ios-simulator - TARGET_GLES2=ON - language: cpp os: osx osx_image: xcode7.3 env: - JOBID=ios-gles3 - TARGET=ios-simulator - TARGET_GLES2=OFF - language: cpp os: osx # Since August 1st, 2019, tests that iterate over 65536 elements # (MathHalfTest, MathPackingTest and MathColorTest) are segfaulting on the # xcode9.3 image. Using whatever image is the default instead. #osx_image: xcode9.3 env: - JOBID=emscripten-webgl1 - TARGET=emscripten - TARGET_GLES2=ON - language: cpp os: osx # Since August 1st, 2019, tests that iterate over 65536 elements # (MathHalfTest, MathPackingTest and MathColorTest) are segfaulting on the # xcode9.3 image. Using whatever image is the default instead. #osx_image: xcode9.3 env: - JOBID=emscripten-webgl2 - TARGET=emscripten - TARGET_GLES2=OFF - language: android os: linux # Setting xenial here will cause it to use 12.04, with GCC 4.6 and other # prehistoric nightmares. So staying with 14.04 for the time being. dist: trusty env: - JOBID=android-gles2 - TARGET=android - TARGET_GLES2=ON addons: apt: packages: - ninja-build android: components: - build-tools-22.0.1 - android-22 - sys-img-armeabi-v7a-android-22 - language: android os: linux # Setting xenial here will cause it to use 12.04, with GCC 4.6 and other # prehistoric nightmares. So staying with 14.04 for the time being. dist: trusty env: - JOBID=android-gles3 - TARGET=android - TARGET_GLES2=OFF addons: apt: packages: - ninja-build android: components: - build-tools-22.0.1 - android-22 - sys-img-armeabi-v7a-android-22 notifications: webhooks: urls: - https://webhooks.gitter.im/e/00ec7a9066bb0fec98f3 on_success: change on_failure: always on_start: never cache: directories: - $HOME/sdl2 - $HOME/swiftshader - $HOME/cmake install: - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-sanitizers" ] && [ ! "$TARGET" == "android" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export CXX=g++-4.8; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-sanitizers" ]; then export CXX=clang++-3.8; fi - if [ "$BUILD_DEPRECATED" != "OFF" ]; then export BUILD_DEPRECATED=ON; fi - if [ "$BUILD_STATIC" != "ON" ]; then export BUILD_STATIC=OFF; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] ); then export PLATFORM_GL_API=GLX; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-gles" ]; then export PLATFORM_GL_API=EGL; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ]; then wget -nc https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip && unzip -q android-*.zip; fi # Download CMake 3.4.3 to ensure we're still compatible with it (Travis has # 3.9 since December 2017). Also, the PATH setting can't be cached, so it's # separate (bit me two times already). Android needs CMake 3.7, but # https://gitlab.kitware.com/cmake/cmake/issues/17253 is fixed in 3.9.2, so # grab that. FindVulkan is since 3.7, in that case just use the system package. - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-vulkan" ] && [ ! "$TARGET" == "android" ] && [ ! -e "$HOME/cmake/bin" ]; then cd $HOME ; wget -nc --no-check-certificate https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz && mkdir -p cmake && cd cmake && tar --strip-components=1 -xzf ../cmake-3.4.3-Linux-x86_64.tar.gz && cd $TRAVIS_BUILD_DIR ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ] && [ ! -e "$HOME/cmake/bin" ]; then cd $HOME ; wget -nc --no-check-certificate https://cmake.org/files/v3.9/cmake-3.9.2-Linux-x86_64.tar.gz && mkdir -p cmake && cd cmake && tar --strip-components=1 -xzf ../cmake-3.9.2-Linux-x86_64.tar.gz && cd $TRAVIS_BUILD_DIR ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export PATH=$HOME/cmake/bin:$PATH && cmake --version; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja; fi - if [ "$TRAVIS_OS_NAME" == "osx" ] && [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov; fi - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "desktop" ]; then export PLATFORM_GL_API=CGL; fi - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "ios-simulator" ]; then gem install xcpretty; fi # binaryen is a dependency for wasm targets, but homebrew devs don't give a # shit: https://github.com/Homebrew/homebrew-core/issues/47869 Also the # generated .emscripten doesn't have a newline at EOL so the workaround listed # in the issue doesn't work and one has to add explicit \n there to make it # work. EVERYTHING SUCKS NOWADAYS. - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "emscripten" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install emscripten binaryen && export LLVM=/usr/local/opt/emscripten/libexec/llvm/bin && emcc && echo -e "\nBINARYEN_ROOT = '/usr/local'\n" >> ~/.emscripten; fi - if [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] || [ "$TARGET" == "desktop-gles" ]; then printf "[General]\ndrivers=null" > ~/.alsoftrc; fi # SDL on macOS and iOS (cached) - if [ "$TRAVIS_OS_NAME" == "osx" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-vulkan" ] ); then HOMEBREW_NO_AUTO_UPDATE=1 brew install sdl2; fi - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "ios-simulator" ]; then curl -O https://www.libsdl.org/release/SDL2-2.0.4.tar.gz && tar -xzvf SDL2-2.0.4.tar.gz && cd SDL2-2.0.4/Xcode-iOS/SDL && xcodebuild -sdk iphonesimulator9.3 | xcpretty && mkdir -p ../../../sdl2/lib && cp build/Release-iphonesimulator/libSDL2.a ../../../sdl2/lib && mkdir -p ../../../sdl2/include/SDL2 && cp -R ../../include/* ../../../sdl2/include/SDL2 && cd ../../..; fi # GLFW (cached) - if [ "$TRAVIS_OS_NAME" == "osx" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-vulkan" ] ); then HOMEBREW_NO_AUTO_UPDATE=1 brew install glfw; fi # SwiftShader on Linux (cached). Taken from Chromium snapshot 587878 # (swiftshader-bin Arch package). - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-gles" ] && [ ! -e "$HOME/swiftshader/libEGL.so" ]; then cd $HOME ; wget https://ci.magnum.graphics/swiftshader-chromium-587878.tar.gz && mkdir -p swiftshader && cd swiftshader && tar -xzf ../swiftshader-chromium-587878.tar.gz && cd $TRAVIS_BUILD_DIR ; fi script: - if [ "$TRAVIS_OS_NAME" == "linux" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] ); then ./package/ci/travis-desktop.sh; fi # Vulkan needs to be in a separate build, because it needs new CMake (for the # Find module) and in the future also C++14. Unfortunately that means we can't # apply the sanitizer or non-deprecated build on it. - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-vulkan" ]; then ./package/ci/travis-desktop-vulkan.sh; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-gles" ]; then ./package/ci/travis-desktop-gles.sh; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ]; then ./package/ci/travis-android-arm.sh; fi - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "desktop" ]; then ./package/ci/travis-desktop.sh; fi - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "ios-simulator" ]; then ./package/ci/travis-ios-simulator.sh; fi - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "emscripten" ]; then ./package/ci/travis-emscripten.sh; fi # Travis somehow is not able to gather all output, try to force it using this - sync after_success: # Keep in sync with PKBUILD-coverage and appveyor-lcov.sh, please - if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then lcov $LCOV_EXTRA_OPTS --directory . --capture --output-file coverage.info > /dev/null; fi - if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then lcov $LCOV_EXTRA_OPTS --extract coverage.info "*/src/Magnum*/*" --output-file coverage.info > /dev/null; fi - if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/MagnumExternal/*" --output-file coverage.info > /dev/null; fi - if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/Test/*" --output-file coverage.info > /dev/null; fi - if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/build/src/*" --output-file coverage.info > /dev/null; fi - if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.info; fi