From: Dmitry V. Levin Date: Sat, 18 Jun 2016 22:53:25 +0000 (+0000) Subject: Split travis-ci.sh X-Git-Tag: v4.13~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb7409c87a1382bd8193ec6e334a400b1e22c302;p=strace Split travis-ci.sh * travis-ci.sh: Split into travis-build.sh, travis-install.sh, and travis-success.sh files. * .travis.yml (before_install, after_success, git): New mappings. (script): Change to travis-build.sh. (addons, install): Remove. (env): Remove matrix. (matrix): Replace exclude list with include list. --- diff --git a/.travis.yml b/.travis.yml index 6a77b215..d3307a02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,38 +2,40 @@ language: c dist: trusty -script: ./travis-ci.sh +before_install: ./travis-install.sh -sudo: required +script: ./travis-build.sh -compiler: - - gcc - - clang-3.6 - - musl-gcc +after_success: ./travis-success.sh -addons: - apt: - packages: - - gcc-multilib - - lcov +sudo: required -install: - - pip install --user codecov +git: + depth: 2147483647 env: global: - SLEEP_A_BIT="sleep 0.2" - VERBOSE="1" - matrix: - - TARGET=x86_64 - - TARGET=x32 - - TARGET=x86 matrix: - exclude: + include: + - compiler: gcc + env: + - TARGET=x86_64 + - COVERAGE=true + - compiler: gcc + env: + - TARGET=x32 + - compiler: gcc + env: + - TARGET=x86 - compiler: clang-3.6 - env: TARGET=x32 + env: + - TARGET=x86_64 - compiler: musl-gcc - env: TARGET=x32 - - compiler: musl-gcc - env: TARGET=x86 + env: + - TARGET=x86_64 + - compiler: clang-3.6 + env: + - TARGET=x86 diff --git a/travis-build.sh b/travis-build.sh new file mode 100755 index 00000000..e6da4bb1 --- /dev/null +++ b/travis-build.sh @@ -0,0 +1,32 @@ +#!/bin/sh -ex + +case "$CC" in + gcc) + ENABLE_GCC_WERROR=--enable-gcc-Werror + ;; + clang-*) + # clang -mx32 fails with the following error: + # clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) + export st_cv_mx32_runtime=no + ;; +esac + +case "${TARGET-}" in + x32) + CC="$CC -mx32" + ;; + x86) + CC="$CC -m32" + export DISTCHECK_CONFIGURE_FLAGS='--build=i686-pc-linux-gnu' + ;; +esac + +$CC --version +export CC_FOR_BUILD="$CC" + +./git-set-file-times +./bootstrap +./configure --enable-maintainer-mode ${ENABLE_GCC_WERROR-} ${DISTCHECK_CONFIGURE_FLAGS-} + +j=-j`getconf _NPROCESSORS_ONLN 2> /dev/null` || j= +make -k $j distcheck VERBOSE=${VERBOSE-} diff --git a/travis-ci.sh b/travis-ci.sh deleted file mode 100755 index 817e50cf..00000000 --- a/travis-ci.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -ex - -case "$CC" in - gcc) - ENABLE_GCC_WERROR=--enable-gcc-Werror - ;; - clang-*) - sudo apt-get -qq update - sudo apt-get -qq --no-install-suggests --no-install-recommends install -y \ - "$CC" - # clang -mx32 fails with the following error: - # clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) - export st_cv_mx32_runtime=no - ;; - musl-gcc) - sudo add-apt-repository ppa:bortis/musl -y - sudo apt-get -qq update - sudo apt-get -qq --no-install-suggests --no-install-recommends install -y \ - musl-tools linux-musl-dev - ;; -esac - -case "${TARGET-}" in - x32) - CC="$CC -mx32" - ;; - x86) - export DISTCHECK_CONFIGURE_FLAGS='--build=i686-pc-linux-gnu' - CC="$CC -m32" - ;; -esac -export CC_FOR_BUILD="$CC" - -$CC --version - -git fetch --unshallow -./git-set-file-times -./bootstrap -./configure --enable-maintainer-mode ${ENABLE_GCC_WERROR-} ${DISTCHECK_CONFIGURE_FLAGS-} -j=-j`getconf _NPROCESSORS_ONLN 2> /dev/null` || j= -make -k $j distcheck VERBOSE=${VERBOSE-} - -if [ "$CC:${TARGET-}" = 'gcc:x86_64' ]; then - set -- strace-*.tar.xz - tar -xf "$1" - dir="${1%.tar.xz}" - cd "$dir" - ./configure --enable-code-coverage ${ENABLE_GCC_WERROR-} ${DISTCHECK_CONFIGURE_FLAGS-} - make -k $j - make -k $j check VERBOSE=${VERBOSE-} - codecov --gcov-args=-abcp ||: -fi diff --git a/travis-install.sh b/travis-install.sh new file mode 100755 index 00000000..567a49b3 --- /dev/null +++ b/travis-install.sh @@ -0,0 +1,30 @@ +#!/bin/sh -ex + +updated= +apt_get_install() +{ + [ -n "$updated" ] || { + sudo apt-get -qq update + updated=1 + } + sudo apt-get -qq --no-install-suggests --no-install-recommends \ + install -y "$@" +} + +case "$CC" in + gcc) + apt_get_install gcc-multilib + ;; + clang-*) + apt_get_install gcc-multilib "$CC" + ;; + musl-gcc) + sudo add-apt-repository ppa:bortis/musl -y + apt_get_install gcc-multilib musl-tools linux-musl-dev + ;; +esac + +if [ "${COVERAGE-}" = true ]; then + apt_get_install lcov + pip install --user codecov +fi diff --git a/travis-success.sh b/travis-success.sh new file mode 100755 index 00000000..cb04d45d --- /dev/null +++ b/travis-success.sh @@ -0,0 +1,12 @@ +#!/bin/sh -ex + +if [ "${COVERAGE-}" = true ]; then + set -- strace-*.tar.xz + tar -xf "$1" + dir="${1%.tar.xz}" + cd "$dir" + export CC_FOR_BUILD="$CC" + ./configure --enable-code-coverage + make -k $j all check VERBOSE=${VERBOSE-} + codecov --gcov-args=-abcp ||: +fi