From beea1fa90a1f0a8b318f757a2532135ca8e7be92 Mon Sep 17 00:00:00 2001 From: Rene Milk <rene.milk@wwu.de> Date: Thu, 17 Aug 2017 10:33:05 +0200 Subject: [PATCH] [ci] fixup missing template substitution --- .travis.after_script.bash | 3 ++- .travis.make_env_file.py | 13 +++++++++++++ .travis.script.bash | 18 +++++++++++++++--- .travis.yml | 20 +++++++++----------- 4 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 .travis.make_env_file.py diff --git a/.travis.after_script.bash b/.travis.after_script.bash index aef9e7c56..a5d673ba9 100755 --- a/.travis.after_script.bash +++ b/.travis.after_script.bash @@ -1,6 +1,7 @@ #!/bin/bash # ****** THIS FILE IS AUTOGENERATED, DO NOT EDIT ********** +# this file is treated as a jinja2 template if [[ $TRAVIS_JOB_NUMBER == *.2 ]] ; then git config --global hooks.clangformat ${CLANG_FORMAT} @@ -12,4 +13,4 @@ if [[ $TRAVIS_JOB_NUMBER == *.2 ]] ; then ${SUPERDIR}/.ci/deploy_docs.sh ${MY_MODULE} "${DUNE_BUILD_DIR}" fi -# ****** THIS FILE IS AUTOGENERATED, DO NOT EDIT ********** +# ****** THIS FILE IS AUTOGENERATED, DO NOT EDIT ********** \ No newline at end of file diff --git a/.travis.make_env_file.py b/.travis.make_env_file.py new file mode 100644 index 000000000..90cf7d720 --- /dev/null +++ b/.travis.make_env_file.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +import os +from os.path import expanduser +home = expanduser("~") + +prefixes = os.environ.get('ENV_PREFIXES', 'TRAVIS CI encrypt TOKEN TESTS').split(' ') +env_file = os.environ.get('ENV_FILE', os.path.join(home, 'env')) +with open(env_file, 'wt') as env: + for k,v in os.environ.items(): + for pref in prefixes: + if k.startswith(pref): + env.write('{}="{}"\n'.format(k,v)) \ No newline at end of file diff --git a/.travis.script.bash b/.travis.script.bash index 9c86838c3..5f7289a24 100755 --- a/.travis.script.bash +++ b/.travis.script.bash @@ -1,18 +1,30 @@ #!/bin/bash # ****** THIS FILE IS AUTOGENERATED, DO NOT EDIT ********** +# this file is treated as a jinja2 template set -e set -x ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} configure ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${BUILD_CMD} -${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${BUILD_CMD} test_binaries +if [ x"${TESTS}" == x ] ; then + ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ninja -v test_binaries +else + ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ninja -v test_binaries_builder_${TESTS} +fi if [[ "${CC}" == "gcc"* ]] ; then lcov -q --gcov-tool ${GCOV} -b ${SUPERDIR}/${MY_MODULE} -d ${DUNE_BUILD_DIR}/${MY_MODULE} -c -o ${HOME}/baseline.lcov --no-external --initial fi -${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${BUILD_CMD} test +source ${OPTS} +CTEST="ctest -V --timeout ${DXT_TEST_TIMEOUT:-300} -j ${DXT_TEST_PROCS:-2}" + +if [ x"${TESTS}" == x ] ; then + ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${CTEST} +else + ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${CTEST} -L "^builder_${TESTS}$" +fi ${SUPERDIR}/.ci/init_sshkey.bash ${encrypted_862ca47045d1_key} ${encrypted_862ca47045d1_iv} keys/dune-community/dune-xt-common-testlogs # retry this step becuase of the implicated race condition in cloning and pushing with multiple builder running in parallel ${SUPERDIR}/scripts/bash/travis_upload_test_logs.bash ${DUNE_BUILD_DIR}/${MY_MODULE}/dune/xt/*/test/ @@ -21,4 +33,4 @@ ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${BUILD_CMD} headercheck ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${BUILD_CMD} install | grep -v "Installing" ${SRC_DCTRL} ${BLD} --only=${MY_MODULE} bexec ${BUILD_CMD} package_source -# ****** THIS FILE IS AUTOGENERATED, DO NOT EDIT ********** +# ****** THIS FILE IS AUTOGENERATED, DO NOT EDIT ********** \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d493bfb1f..776a6da56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ # This file is part of the dune-xt-common project: # https://github.com/dune-community/dune-xt-common -# Copyright 2009-2017 dune-xt-common developers and contributors. All rights reserved. +# Copyright 2009-2017 dune-xt-functions developers and contributors. All rights reserved. # License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) # or GPL-2.0+ (http://opensource.org/licenses/gpl-license) # with "runtime exception" (http://www.dune-project.org/license.html) # Authors: -# Felix Schindler (2015 - 2017) -# Rene Milk (2015 - 2017) -# Tobias Leibner (2015 - 2016) +# Felix Schindler (2016 - 2017) +# Rene Milk (2016 - 2017) +# Tobias Leibner (2016) sudo: required dist: trusty @@ -19,9 +19,7 @@ before_script: # get image with fallback to master branch of the super repo - docker pull ${IMAGE} || export IMAGE="dunecommunity/${MY_MODULE}-testing_${DOCKER_TAG}:master" ; docker pull ${IMAGE} - export ENV_FILE=${HOME}/env - - printenv | \grep TRAVIS > ${ENV_FILE} - - printenv | \grep encrypt >> ${ENV_FILE} - - printenv | \grep TOKEN >> ${ENV_FILE} + - python ./.travis.make_env_file.py - export DOCKER_RUN="docker run --env-file ${ENV_FILE} -v ${TRAVIS_BUILD_DIR}:/root/src/${MY_MODULE} ${IMAGE}" script: @@ -51,7 +49,7 @@ env: matrix: include: - - env: DOCKER_TAG=gcc_full - - env: DOCKER_TAG=gcc_no_istl_no_disc - - env: DOCKER_TAG=gcc_no_disc - - env: DOCKER_TAG=clang_full + - env: DOCKER_TAG=gcc_full + - env: DOCKER_TAG=gcc_no_istl_no_disc + - env: DOCKER_TAG=gcc_no_disc + - env: DOCKER_TAG=clang_full \ No newline at end of file -- GitLab