diff --git a/.codecov.yml b/.codecov.yml index 4f00880..c9fb29b 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -6,7 +6,7 @@ coverage: status: project: no patch: yes - changes: yes + changes: no comment: layout: "header, diff, changes, tree" diff --git a/.travis.yml b/.travis.yml index 7628543..e69e2db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ -dist: trusty language: c env: global: @@ -18,7 +17,7 @@ addons: matrix: include: - - env: CFLAGS="-O2" + - env: CFLAGS="-O2" CC=clang CXX=clang++ compiler: clang - env: CFLAGS="-O2" compiler: gcc @@ -30,10 +29,10 @@ branches: - master before_script: + - export GAPROOT="$HOME/gap" - scripts/build_gap.sh script: - - scripts/build_pkg.sh - - scripts/run_tests.sh + - scripts/build_pkg.sh && scripts/run_tests.sh after_script: - bash scripts/gather-coverage.sh - bash <(curl -s https://codecov.io/bash) diff --git a/scripts/build_gap.sh b/scripts/build_gap.sh index 2596e66..9dfab12 100755 --- a/scripts/build_gap.sh +++ b/scripts/build_gap.sh @@ -1,39 +1,31 @@ #!/usr/bin/env bash set -ex -# build GAP in a subdirectory -git clone --depth=2 https://github.com/gap-system/gap.git $GAPROOT +# clone GAP into a subdirectory +git clone --depth=2 -b ${GAPBRANCH:-master} https://github.com/gap-system/gap.git $GAPROOT cd $GAPROOT -./autogen.sh -./configure -make -j4 V=1 -make bootstrap-pkg-minimal -if [[ $ABI == 32 ]] -then - CONFIGFLAGS="CFLAGS=-m32 LDFLAGS=-m32 LOPTS=-m32 CXXFLAGS=-m32" +# for HPC-GAP, install ward, add suitable flags +if [[ $HPCGAP = yes ]]; then + git clone https://github.com/gap-system/ward + cd ward + CFLAGS= LDFLAGS= ./build.sh + cd .. + GAP_CONFIGFLAGS="$GAP_CONFIGFLAGS --enable-hpcgap" fi -# build some packages... -cd pkg - -# install latest version of io -git clone https://github.com/gap-packages/io -cd io +# build GAP in a subdirectory ./autogen.sh -./configure $CONFIGFLAGS +./configure $GAP_CONFIGFLAGS make -j4 V=1 -cd .. -# install latest version of profiling -git clone https://github.com/gap-packages/profiling -cd profiling -./autogen.sh -# HACK to workaround problems when building with clang -if [[ $CC = clang ]] -then - export CXX=clang++ -fi -./configure $CONFIGFLAGS -make -j4 V=1 -cd .. +# download packages; instruct wget to retry several times if the +# connection is refused, to work around intermittent failures +make bootstrap-pkg-full WGET="wget -N --no-check-certificate --tries=5 --waitretry=5 --retry-connrefused" + +# build some packages (default is to build 'io' and 'profiling', +# in order to generate coverage results) +cd pkg +for pkg in ${GAP_PKGS_TO_BUILD-io profiling}; do + ../bin/BuildPackages.sh --strict $pkg* +done diff --git a/scripts/build_pkg.sh b/scripts/build_pkg.sh index 0d5fdc9..4926fe1 100755 --- a/scripts/build_pkg.sh +++ b/scripts/build_pkg.sh @@ -5,19 +5,20 @@ set -ex export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" export LDFLAGS="$LDFLAGS -fprofile-arcs" -if [[ $ABI = 32 ]] -then +if [[ $ABI = 32 ]]; then export CFLAGS="$CFLAGS -m32" export LDFLAGS="$LDFLAGS -m32" fi # build this package -./autogen.sh -./configure --with-gaproot=$GAPROOT -make -j4 V=1 +if [[ -x autogen.sh ]]; then + ./autogen.sh + ./configure --with-gaproot=$GAPROOT + make -j4 V=1 +elif [[ -x configure ]]; then + ./configure $GAPROOT + make -j4 +fi -# ... and link it into GAP pkg dir -ls -ls $GAPROOT -ls $GAPROOT/pkg -ln -s $PWD $GAPROOT/pkg/ +# trick to allow the package directory to be used as a GAP root dir +ln -s . pkg diff --git a/scripts/gather-coverage.sh b/scripts/gather-coverage.sh index 485180b..cfbd672 100755 --- a/scripts/gather-coverage.sh +++ b/scripts/gather-coverage.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash set -ex -GAP="$GAPROOT/bin/gap.sh --quitonbreak -q" +# If we don't care about code coverage, do nothing +if [[ -n $NO_COVERAGE ]]; then + exit 0 +fi + +GAP="$GAPROOT/bin/gap.sh -l $PWD; --quitonbreak -q" # generate library coverage reports $GAP -a 500M -m 500M -q <