From 6d3201cff04efe009763d868ca328c238d1fd239 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Tue, 13 Nov 2018 21:56:56 +0000 Subject: [PATCH] [travis] Build coverage and debug builds in separate jobs Makes builds twice as fast. Closes https://github.com/postgis/postgis/pull/333 git-svn-id: http://svn.osgeo.org/postgis/trunk@17013 b70326c6-7e19-0410-871a-916f4a2858ee --- .travis.yml | 17 ++++++++++------- ci/travis/run_coverage.sh | 12 ++++++++++++ ci/travis/run_debug.sh | 8 ++++++++ ci/travis/run_tests.sh | 13 ------------- 4 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 ci/travis/run_coverage.sh create mode 100644 ci/travis/run_debug.sh diff --git a/.travis.yml b/.travis.yml index 0cb00034b..418ec5db1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,21 +5,24 @@ sudo: true language: c env: - - tag=latest - - tag=pg11-geos37-gdal23-proj52 - - tag=pg10-geos36-gdal23-proj49 - - tag=pg96-geos36-gdal22-proj49 - - tag=pg95-geos35-gdal111-proj48 + - tag=latest mode=tests + - tag=pg11-geos37-gdal23-proj52 mode=debug + - tag=pg11-geos37-gdal23-proj52 mode=coverage + - tag=pg11-geos37-gdal23-proj52 mode=tests + - tag=pg10-geos36-gdal23-proj49 mode=tests + - tag=pg96-geos36-gdal22-proj49 mode=tests + - tag=pg95-geos35-gdal111-proj48 mode=tests matrix: allow_failures: - - env: tag=latest + - env: tag=latest mode=tests + - env: tag=pg11-geos37-gdal23-proj52 mode=coverage script: - echo "/tmp/logbt-coredumps/core.%p.%E" | sudo tee /proc/sys/kernel/core_pattern - echo "FROM postgis/postgis-build-env:${tag}" > Dockerfile - echo "ADD --chown=postgres:postgres . /src/postgis" >> Dockerfile - - echo "CMD bash ci/travis/run_tests.sh && bash .github/codecov.bash" >> Dockerfile + - echo "CMD bash ci/travis/run_${mode}.sh" >> Dockerfile - docker build -t pgtest . - ci_env=`bash .github/codecov_env.bash` - docker run $ci_env --name pgtest-${TRAVIS_BUILD_NUMBER} pgtest diff --git a/ci/travis/run_coverage.sh b/ci/travis/run_coverage.sh new file mode 100644 index 000000000..70e6e21a1 --- /dev/null +++ b/ci/travis/run_coverage.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e + +# Flags for coverage build +CFLAGS_COV="-g -O0 --coverage" +LDFLAGS_COV="--coverage" + +/usr/local/pgsql/bin/pg_ctl -c -l /tmp/logfile start +./autogen.sh +./configure CFLAGS="${CFLAGS_COV}" LDFLAGS="${LDFLAGS_COV}" --enable-debug +make -j check +bash .github/codecov.bash diff --git a/ci/travis/run_debug.sh b/ci/travis/run_debug.sh new file mode 100644 index 000000000..f3b742afd --- /dev/null +++ b/ci/travis/run_debug.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +./autogen.sh +# Check that compilation works at nonzero POSTGIS_DEBUG_LEVEL +./configure --enable-debug # sets PARANOIA_LEVEL +sed -i 's/POSTGIS_DEBUG_LEVEL [0-9]$/POSTGIS_DEBUG_LEVEL 4/' postgis_config.h +make -j diff --git a/ci/travis/run_tests.sh b/ci/travis/run_tests.sh index 4066b673d..e4d5faebd 100644 --- a/ci/travis/run_tests.sh +++ b/ci/travis/run_tests.sh @@ -8,10 +8,6 @@ WARNINGS_DISABLED="-Wno-unused-parameter -Wno-implicit-fallthrough -Wno-unknown- CFLAGS_STD="-g -O2 -mtune=generic -fno-omit-frame-pointer ${WARNINGS} ${WARNINGS_DISABLED}" LDFLAGS_STD="-Wl,-Bsymbolic-functions -Wl,-z,relro" -# Flags for coverage build -CFLAGS_COV="-g -O0 --coverage" -LDFLAGS_COV="--coverage" - export CUNIT_WITH_VALGRIND=YES export CUNIT_VALGRIND_FLAGS="--leak-check=full --error-exitcode=1" @@ -21,12 +17,3 @@ export CUNIT_VALGRIND_FLAGS="--leak-check=full --error-exitcode=1" # Standard build ./configure CFLAGS="${CFLAGS_STD}" LDFLAGS="${LDFLAGS_STD}" bash ./ci/travis/logbt -- make -j check RUNTESTFLAGS=--verbose - -# Check that compilation works at nonzero POSTGIS_DEBUG_LEVEL -./configure --enable-debug # sets PARANOIA_LEVEL -sed -i 's/POSTGIS_DEBUG_LEVEL [0-9]$/POSTGIS_DEBUG_LEVEL 4/' postgis_config.h -make -j - -# Coverage build -./configure CFLAGS="${CFLAGS_COV}" LDFLAGS="${LDFLAGS_COV}" --enable-debug -make -j check -- 2.40.0