2018-06-22 21:18:30 +10:00
# travis.yml for testing radare2. Initially written in 2014-2016, by jn__. Updated 2018 by damo22
2015-10-11 00:08:47 +02:00
2018-06-23 22:48:33 +10:00
language : generic
2017-06-18 09:32:38 +08:00
dist : trusty
2018-07-12 09:01:50 +02:00
conditions : v1
2018-06-22 21:18:30 +10:00
sudo : required
2015-10-11 00:08:47 +02:00
2019-02-05 17:52:17 +01:00
branches :
only :
- master
2019-03-26 08:18:33 +01:00
- /^release-.*$/
- /^prerelease-.*$/
2019-02-05 17:52:17 +01:00
2018-06-22 21:18:30 +10:00
services :
- docker
2015-04-03 15:41:48 +02:00
2018-06-23 22:48:33 +10:00
os : osx
matrix :
2018-07-12 09:01:50 +02:00
fast_finish : true
2018-06-23 22:48:33 +10:00
include :
2019-02-28 16:58:09 +01:00
# Linux with GCC
2018-06-23 22:48:33 +10:00
- os : linux
2019-06-27 23:05:05 +02:00
env : COMPILER_NAME=gcc CXX=g++ CC=gcc CFLAGS="-DR2_ASSERT_STDOUT=1"
2019-02-28 16:58:09 +01:00
# Linux with clang
2018-06-23 22:48:33 +10:00
- os : linux
2019-06-27 23:05:05 +02:00
env : COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-DR2_ASSERT_STDOUT=1"
2019-05-30 12:56:04 +02:00
# Linux with meson and coverage and asserts
2018-07-09 16:58:38 +02:00
- os : linux
2019-05-30 12:56:04 +02:00
env : COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson COVERAGE=1 CFLAGS="-DR2_ASSERT_STDOUT=1"
2019-02-28 16:58:09 +01:00
# OS X with clang
2018-06-23 22:48:33 +10:00
- os : osx
2019-12-16 23:23:17 +01:00
env : COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-DR2_ASSERT_STDOUT=1"
2019-06-08 23:26:19 +03:00
# Run Fuzzing Sanity Test on every push
2019-08-03 18:02:50 -07:00
# XXX its broken it complains about invalid key
#- os: linux
# env: COMPILER_NAME=clang CXX=clang++ CC=clang R2_TESTS_DISABLE=1 FUZZIT=0 INSTALL_SYSTEM=static CXXFLAGS="-fsanitize=fuzzer"
2019-02-28 16:58:09 +01:00
# ASAN as a best effort on every push
2019-03-26 08:18:33 +01:00
- if : (not head_branch =~ ^release-* AND not head_branch =~ ^prerelease-* AND not branch =~ ^release-* AND not branch =~ ^prerelease-*) AND (head_branch =~ ^asan-* OR type = push)
2019-02-28 16:58:09 +01:00
os : linux
2019-06-27 23:05:05 +02:00
env : COMPILER_NAME=clang CXX=clang++ CC=clang ASAN=1 ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0 CFLAGS="-DR2_ASSERT_STDOUT=1"
2019-02-28 16:58:09 +01:00
# release-only: meson build with system libraries
2019-03-26 08:18:33 +01:00
- if : head_branch =~ ^release-* OR head_branch =~ ^prerelease-* OR branch =~ ^release-* OR branch =~ ^prerelease-*
2019-02-28 16:58:09 +01:00
os : linux
env : COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_MAGIC=true R2_SYS_ZIP=true R2_SYS_LZ4=true R2_SYS_ZLIB=true R2_SYS_OPENSSL=true
# release-only: meson build with ASAN and R2_ASSERT_STDOUT
2019-03-26 08:18:33 +01:00
- if : head_branch =~ ^release-* OR head_branch =~ ^prerelease-* OR branch =~ ^release-* OR branch =~ ^prerelease-*
2019-02-28 16:58:09 +01:00
os : linux
env : COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-DR2_ASSERT_STDOUT=1" ASAN=1 ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0 RELEASE=1
# release-only: nogpl plugins file, just test if it builds
2019-03-26 08:18:33 +01:00
- if : head_branch =~ ^release-* OR head_branch =~ ^prerelease-* OR branch =~ ^release-* OR branch =~ ^prerelease-*
2019-02-28 16:58:09 +01:00
os : linux
env : COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=nogpl R2_TESTS_DISABLE=1
# release-only: static plugins file, just test if it builds
2019-03-26 08:18:33 +01:00
- if : head_branch =~ ^release-* OR head_branch =~ ^prerelease-* OR branch =~ ^release-* OR branch =~ ^prerelease-*
2019-02-28 16:58:09 +01:00
os : linux
env : COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=static R2_TESTS_DISABLE=1
# release-only: tiny plugins file, just test if it builds
2019-03-26 08:18:33 +01:00
- if : head_branch =~ ^release-* OR head_branch =~ ^prerelease-* OR branch =~ ^release-* OR branch =~ ^prerelease-*
2019-02-28 16:58:09 +01:00
os : linux
env : COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=tiny R2_TESTS_DISABLE=1
# release-only: system capstone (capstone3), just test if it builds
2019-03-26 08:18:33 +01:00
- if : head_branch =~ ^release-* OR head_branch =~ ^prerelease-* OR branch =~ ^release-* OR branch =~ ^prerelease-*
2019-02-28 16:58:09 +01:00
os : linux
env : COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_CAPSTONE=true R2_TESTS_DISABLE=1
2018-07-06 23:35:55 +02:00
allow_failures :
2018-07-09 16:58:38 +02:00
- os : linux
2019-06-27 23:05:05 +02:00
env : COMPILER_NAME=clang CXX=clang++ CC=clang ASAN=1 ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0 CFLAGS="-DR2_ASSERT_STDOUT=1"
2019-06-08 23:26:19 +03:00
2015-11-27 23:48:47 +01:00
cache :
- ccache
2015-08-28 16:03:13 +02:00
2019-01-09 18:48:02 +01:00
addons :
homebrew :
packages :
- libuv
- cabextract
2018-06-22 21:18:30 +10:00
before_install :
2019-06-08 23:26:19 +03:00
- |
if [ "${FUZZIT}" == "1" ]; then
docker pull gcr.io/fuzzit-public/builders:llvm9.v1
elif [ "$TRAVIS_OS_NAME" != "osx" ]; then
docker pull radareorg/r2-travis:latest || docker build -t radareorg/r2-travis:latest -f Dockerfile.travis .
else
2019-10-21 00:30:55 +02:00
rm -rf .nvm && git clone -q https://github.com/creationix/nvm.git .nvm && (cd .nvm && git checkout `git describe --abbrev=0 --tags`) && . .nvm/nvm.sh && nvm install 10.16.3
2019-06-08 23:26:19 +03:00
fi
2017-03-21 19:17:58 +01:00
2014-06-13 02:45:31 +02:00
script :
2018-02-27 22:26:54 +01:00
- export PR_NAME=$(echo $TRAVIS_PULL_REQUEST_SLUG | cut -d'/' -f1)
2019-06-08 23:26:19 +03:00
- |
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
$SHELL ./travis-extract-var.sh > ${TRAVIS_BUILD_DIR}/docker-env.sh ; cat ${TRAVIS_BUILD_DIR}/docker-env.sh
fi
- |
if [ "${FUZZIT}" == "1" ] ; then
docker run -v /home/travis/.ccache:/root/.ccache -v "${TRAVIS_BUILD_DIR}":"${TRAVIS_BUILD_DIR}" --entrypoint "/bin/bash" gcr.io/fuzzit-public/builders:llvm9.v1 -c "cd ${TRAVIS_BUILD_DIR}; . docker-env.sh; bash travis-script"
elif [ "$TRAVIS_OS_NAME" != "osx" ] ; then
docker run -v /home/travis/.ccache:/root/.ccache -v "${TRAVIS_BUILD_DIR}":"${TRAVIS_BUILD_DIR}" --entrypoint "/bin/bash" radareorg/r2-travis:latest -c ". /src/.nvm/nvm.sh; cd ${TRAVIS_BUILD_DIR}; . docker-env.sh; bash travis-script"
else
$SHELL travis-script
fi