enable codecov.io (#11279)

* enable codecov.io
This commit is contained in:
Riccardo Schirone 2018-09-03 18:05:29 +02:00 committed by GitHub
parent c610b85209
commit 7936da85fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 13 deletions

View File

@ -24,6 +24,8 @@ matrix:
- if: head_branch =~ ^asan-* OR tag =~ ^release-* OR type = push
os: linux
env: COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer" ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0
- os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc COVERAGE=1 INSTALL_SYSTEM=meson
- os: osx
env: COMPILER_NAME=clang CXX=clang++ CC=clang
allow_failures:
@ -31,6 +33,8 @@ matrix:
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_CAPSTONE=true R2_SYS_MAGIC=true R2_SYS_ZIP=true R2_SYS_LZ4=true R2_SYS_ZLIB=true
- os: linux
env: COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer" ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0
- os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc COVERAGE=1 INSTALL_SYSTEM=meson
cache:
- ccache
@ -46,8 +50,8 @@ script:
- export R2R_BRANCH=$([ -n "${TRAVIS_PULL_REQUEST_BRANCH}" ] && echo "${TRAVIS_PULL_REQUEST_BRANCH}" || echo "${R2R_DEFAULT_BRANCH}")
- if [ "${R2R_BRANCH}" = master ]; then USER_NAME=radare; fi
- export R2R_REPO=$(doc/repo PR_REGRESSIONS | sed "s/__USER__/${USER_NAME}/g")
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then bash ./travis-extract-var.sh > ${TRAVIS_BUILD_DIR}/docker-env.sh ; cat ${TRAVIS_BUILD_DIR}/docker-env.sh ; fi
- if [ "$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 bash travis-script; fi
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then bash ./travis-extract-var.sh > ${TRAVIS_BUILD_DIR}/docker-env.sh ; cat ${TRAVIS_BUILD_DIR}/docker-env.sh ; ci_env=`bash <(curl -s https://codecov.io/env)` ; echo "${ci_env}" ; fi
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then docker run ${ci_env} -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 bash travis-script; fi
notifications:
irc: "chat.freenode.net#radare"

View File

@ -5,13 +5,13 @@ print_var()
VAR_NAME=$1
VAR_VALUE=$2
if [ "${VAR_VALUE}" != "" ] ; then
printf "export %s=%q\n" "${VAR_NAME}" "${VAR_VALUE}"
printf "export %s=%q\n" "${VAR_NAME}" "${VAR_VALUE}"
fi
}
env -0 | while IFS='=' read -r -d '' n v; do
if [[ "${n}" =~ ^TRAVIS_* || "${n}" =~ ^R2* || "${n}" =~ SAN_* ]]; then
print_var "${n}" "${v}"
print_var "${n}" "${v}"
fi
done
@ -22,3 +22,5 @@ print_var CFLAGS "${CFLAGS}"
print_var LDFLAGS "${LDFLAGS}"
print_var CXXFLAGS "${CXXFLAGS}"
print_var INSTALL_SYSTEM "${INSTALL_SYSTEM}"
print_var MESON_OPTIONS "${MESON_OPTIONS}"
print_var COVERAGE "${COVERAGE}"

View File

@ -11,19 +11,22 @@ if [ "${INSTALL_SYSTEM}" == "meson" ] ; then
OPTS=""
if [ "${R2_SYS_CAPSTONE}" != "" ] ; then
OPTS="${OPTS} -D use_sys_capstone=${R2_SYS_CAPSTONE}"
OPTS="${OPTS} -D use_sys_capstone=${R2_SYS_CAPSTONE}"
fi
if [ "${R2_SYS_MAGIC}" != "" ] ; then
OPTS="${OPTS} -D use_sys_magic=${R2_SYS_MAGIC}"
OPTS="${OPTS} -D use_sys_magic=${R2_SYS_MAGIC}"
fi
if [ "${R2_SYS_ZLIB}" != "" ] ; then
OPTS="${OPTS} -D use_sys_zlib=${R2_SYS_ZLIB}"
OPTS="${OPTS} -D use_sys_zlib=${R2_SYS_ZLIB}"
fi
if [ "${R2_SYS_ZIP}" != "" ] ; then
OPTS="${OPTS} -D use_sys_zip=${R2_SYS_ZIP}"
OPTS="${OPTS} -D use_sys_zip=${R2_SYS_ZIP}"
fi
if [ "${R2_SYS_LZ4}" != "" ] ; then
OPTS="${OPTS} -D use_sys_lz4=${R2_SYS_LZ4}"
OPTS="${OPTS} -D use_sys_lz4=${R2_SYS_LZ4}"
fi
if [ "${COVERAGE}" == "1" ] ; then
OPTS="${OPTS} -Db_coverage=true"
fi
meson --prefix=${TRAVIS_BUILD_DIR}/install ${OPTS} build
@ -39,10 +42,6 @@ else
make install > /dev/null || exit 1
export PKG_CONFIG_PATH=${TRAVIS_BUILD_DIR}/pkgcfg:${PKG_CONFIG_PATH}
fi
#[ "$TRAVIS_OS_NAME" != "osx" ] && mkdir -p /tmp/kcov && pushd /tmp/kcov
#[ "$TRAVIS_OS_NAME" != "osx" ] && mkdir ${TRAVIS_BUILD_DIR}/kcov
#[ "$TRAVIS_OS_NAME" != "osx" ] && wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make && make install DESTDIR=../tmp && popd
#[ "$TRAVIS_OS_NAME" != "osx" ] && export KCOV="/tmp/kcov/kcov-master/tmp/usr/local/bin/kcov --coveralls-id=$TRAVIS_JOB_ID ${TRAVIS_BUILD_DIR}/kcov"
export NOOK=1
export NOREPORT=1
cd radare2-regressions
@ -50,3 +49,10 @@ git remote -v
git branch
git rev-parse HEAD
VERBOSE=1 make -k all
if [ "${COVERAGE}" == "1" ] ; then
cd ../build
curl -s https://codecov.io/bash > ./codecov.sh
chmod +x ./codecov.sh
./codecov.sh -v 2>/dev/null
fi