From 698e6b00e842709c56f5ec61e0c765218fa30016 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Sat, 5 Oct 2019 10:26:02 -0400 Subject: [PATCH] Add preliminary support for using Base releases - shorten BASE variable name (takes tag or branch name) - determine existence and type of BASE before cloning --- .travis.yml.example-full | 38 +++++++++++++++++++++++--------------- .travis.yml.example-mini | 6 +++--- README.md | 4 ++-- travis-prepare.sh | 22 ++++++++++++++++++++-- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/.travis.yml.example-full b/.travis.yml.example-full index cee2d1a..d8c6ac0 100644 --- a/.travis.yml.example-full +++ b/.travis.yml.example-full @@ -27,58 +27,66 @@ script: # Define build jobs +# Well-known variables to use +# BASE branch or release tag name of the EPICS Base to use +# EXTRA content will be added to make command line +# STATIC set to YES for static build (default: NO) +# TEST set to NO to skip running the tests (default: YES) + matrix: include: # Different configurations of default gcc and clang - - env: BASE_BRANCH=7.0 + - env: BASE=7.0 - - env: BASE_BRANCH=7.0 + - env: BASE=7.0 compiler: clang - - env: BASE_BRANCH=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" + - env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" - - env: BASE_BRANCH=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" + - env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" compiler: clang # Trusty: compiler versions very close to RHEL 7 - - env: BASE_BRANCH=7.0 + - env: BASE=7.0 dist: trusty - - env: BASE_BRANCH=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" + - env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" dist: trusty # Cross-compilation to Windows using MinGW and WINE - - env: BASE_BRANCH=7.0 WINE=32 TEST=NO STATIC=YES + - env: BASE=7.0 WINE=32 TEST=NO STATIC=YES compiler: mingw - - env: BASE_BRANCH=7.0 WINE=32 TEST=NO STATIC=NO + - env: BASE=7.0 WINE=32 TEST=NO STATIC=NO compiler: mingw # Cross-compilation to RTEMS - - env: BASE_BRANCH=7.0 RTEMS=4.10 TEST=NO + - env: BASE=7.0 RTEMS=4.10 TEST=NO - - env: BASE_BRANCH=7.0 RTEMS=4.9 TEST=NO + - env: BASE=7.0 RTEMS=4.9 TEST=NO # Other gcc versions (adding as an extra package) - - env: BASE_BRANCH=7.0 + - env: BASE=7.0 compiler: gcc-6 addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } } - - env: BASE_BRANCH=7.0 + - env: BASE=7.0 compiler: gcc-7 addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } } # MacOS build - - env: BASE_BRANCH=7.0 + - env: BASE=7.0 os: osx compiler: clang -# All above jobs can be defined for other branches of EPICS Base -# by setting BASE_BRANCH to the branch name, e.g. 3.15 +# All above jobs can be defined for other branches or releases of EPICS Base +# by setting BASE to the branch name or release tag name, e.g. +# BASE=3.15 (to use the 3.15 branch of Base) +# BASE=R7.0.3 (to use the 7.0.3 release of Base) diff --git a/.travis.yml.example-mini b/.travis.yml.example-mini index 01c8e16..209c093 100644 --- a/.travis.yml.example-mini +++ b/.travis.yml.example-mini @@ -20,9 +20,9 @@ install: script: - ./.ci/travis-build.sh -# Build using default gcc for Base 7.0 and 3.15 +# Build using default gcc for Base branches 7.0 and 3.15 matrix: include: - - env: BASE_BRANCH=7.0 - - env: BASE_BRANCH=3.15 + - env: BASE=7.0 + - env: BASE=3.15 diff --git a/README.md b/README.md index da80b12..3e47bed 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,14 @@ software modules, e.g. Device Support modules. By including this repository as a Git Submodule, your module will always use an explicit commit, i.e. a fixed version of the scripts. -That way, further development of these scripts cannot break +That ensures that further development of these scripts cannot break your setup. ## Travis-CI ### Features - - Compile against different version of EPICS Base + - Compile against different branches or releases of EPICS Base - Use different versions of compilers (gcc, clang) - Cross-compile for Windows 32bit using MinGW and WINE - Cross-compile for RTEMS 4.9 and 4.10 diff --git a/travis-prepare.sh b/travis-prepare.sh index e741096..33acef3 100755 --- a/travis-prepare.sh +++ b/travis-prepare.sh @@ -3,8 +3,26 @@ set -e -x CURDIR="$PWD" +# determine if BASE is a release or a branch +git ls-remote --quiet --exit-code --tags https://github.com/${REPOBASE:-epics-base}/epics-base.git "$BASE" && BASE_RELEASE=YES +git ls-remote --quiet --exit-code --heads https://github.com/${REPOBASE:-epics-base}/epics-base.git "$BASE" && BASE_BRANCH=YES + +if [ "$BASE_RELEASE" = "YES" ] +then + # TODO: use a cached location + BASE_LOCATION=$HOME/.source/epics-base +else + if [ "$BASE_BRANCH" = "YES" ] + then + BASE_LOCATION=$HOME/.source/epics-base + else + echo $BASE is neither a tag nor a branch name for BASE + exit 1 + fi +fi + cat << EOF > $CURDIR/configure/RELEASE.local -EPICS_BASE=$HOME/.source/epics-base +EPICS_BASE=$BASE_LOCATION EOF install -d "$HOME/.source" @@ -25,7 +43,7 @@ EOF } # not recursive -git clone --quiet --depth 5 --branch "$BASE_BRANCH" https://github.com/${REPOBASE:-epics-base}/epics-base.git epics-base +git clone --quiet --depth 5 --branch "$BASE" https://github.com/${REPOBASE:-epics-base}/epics-base.git epics-base (cd epics-base && git log -n1 ) for modrepo in ${MODULES} do