[postgis-tickets] r17013 - [travis] Build coverage and debug builds in separate jobs

Darafei komzpa at gmail.com
Tue Nov 13 01:56:56 PST 2018


Author: komzpa
Date: 2018-11-13 13:56:56 -0800 (Tue, 13 Nov 2018)
New Revision: 17013

Added:
   trunk/ci/travis/run_coverage.sh
   trunk/ci/travis/run_debug.sh
Modified:
   trunk/.travis.yml
   trunk/ci/travis/run_tests.sh
Log:
[travis] Build coverage and debug builds in separate jobs

Makes builds twice as fast.

Closes https://github.com/postgis/postgis/pull/333




Modified: trunk/.travis.yml
===================================================================
--- trunk/.travis.yml	2018-11-13 20:41:38 UTC (rev 17012)
+++ trunk/.travis.yml	2018-11-13 21:56:56 UTC (rev 17013)
@@ -5,21 +5,24 @@
 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

Added: trunk/ci/travis/run_coverage.sh
===================================================================
--- trunk/ci/travis/run_coverage.sh	                        (rev 0)
+++ trunk/ci/travis/run_coverage.sh	2018-11-13 21:56:56 UTC (rev 17013)
@@ -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

Added: trunk/ci/travis/run_debug.sh
===================================================================
--- trunk/ci/travis/run_debug.sh	                        (rev 0)
+++ trunk/ci/travis/run_debug.sh	2018-11-13 21:56:56 UTC (rev 17013)
@@ -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

Modified: trunk/ci/travis/run_tests.sh
===================================================================
--- trunk/ci/travis/run_tests.sh	2018-11-13 20:41:38 UTC (rev 17012)
+++ trunk/ci/travis/run_tests.sh	2018-11-13 21:56:56 UTC (rev 17013)
@@ -8,10 +8,6 @@
 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 @@
 # 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



More information about the postgis-tickets mailing list