From ffafb488608d76bf3974c2bf4966f1134cb95bf6 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Fri, 7 Apr 2017 16:24:42 +0300 Subject: [PATCH] Add packpack / PackageCloud support to .travis.yml. --- .travis.yml | 164 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 132 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index a030577..6ff684a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,11 @@ # # Travis CI configuration -dist: trusty sudo: required +services: + - docker + language: c os: @@ -15,8 +17,75 @@ compiler: - gcc - clang +env: + matrix: + - TARGET=distcheck + - TARGET=test + - TARGET=coverage + - OS=el DIST=6 + - OS=el DIST=7 + - OS=fedora DIST=24 + - OS=fedora DIST=25 + - OS=ubuntu DIST=precise + - OS=ubuntu DIST=trusty + - OS=ubuntu DIST=xenial + - OS=ubuntu DIST=yakkety + - OS=debian DIST=wheezy + - OS=debian DIST=jessie + - OS=debian DIST=stretch + matrix: exclude: + - env: OS=el DIST=6 + compiler: clang + - env: OS=el DIST=7 + compiler: clang + - env: OS=fedora DIST=24 + compiler: clang + - env: OS=fedora DIST=25 + compiler: clang + - env: OS=ubuntu DIST=precise + compiler: clang + - env: OS=ubuntu DIST=trusty + compiler: clang + - env: OS=ubuntu DIST=xenial + compiler: clang + - env: OS=ubuntu DIST=yakkety + compiler: clang + - env: OS=debian DIST=wheezy + compiler: clang + - env: OS=debian DIST=jessie + compiler: clang + - env: OS=debian DIST=stretch + compiler: clang + - env: TARGET=source + compiler: clang + - env: TARGET=coverage + compiler: clang + - env: OS=el DIST=6 + os: osx + - env: OS=el DIST=7 + os: osx + - env: OS=fedora DIST=24 + os: osx + - env: OS=fedora DIST=25 + os: osx + - env: OS=ubuntu DIST=precise + os: osx + - env: OS=ubuntu DIST=trusty + os: osx + - env: OS=ubuntu DIST=xenial + os: osx + - env: OS=ubuntu DIST=yakkety + os: osx + - env: OS=debian DIST=wheezy + os: osx + - env: OS=debian DIST=jessie + os: osx + - env: OS=debian DIST=stretch + os: osx + - env: TARGET=coverage + os: osx - os: osx compiler: gcc @@ -34,35 +103,33 @@ services: before_install: - > - case "${TRAVIS_OS_NAME:-linux}" in - osx) - # Workaround for https://github.com/Homebrew/legacy-homebrew/issues/43874 - # brew uninstall libtool - # brew update --quiet - # brew install libtool mysql - brew install mysql + if [ "x$TARGET" = "xtest" ] then + case "${TRAVIS_OS_NAME:-linux}" in + osx) + brew install mysql - # OS X requires servers to be started explicitly - brew services start mysql + # OS X requires servers to be started explicitly + brew services start mysql - # Avoid PostgreSQL upgrade woes, just reinstall the database - brew uninstall --ignore-dependencies postgresql - rm -rf /usr/local/var/postgres - brew install postgresql + # Avoid PostgreSQL upgrade woes, just reinstall the database + brew uninstall --ignore-dependencies postgresql + rm -rf /usr/local/var/postgres + brew install postgresql - echo "Starting PostgreSQL" - pg_ctl -wD /usr/local/var/postgres start - echo "Creating user postgres" - createuser -s postgres - ;; - linux) - export ASAN_OPTIONS="detect_leaks=0" - if [ "${CC}" = "clang" ] - then - CC=clang-3.6 - fi - ;; - esac + echo "Starting PostgreSQL" + pg_ctl -wD /usr/local/var/postgres start + echo "Creating user postgres" + createuser -s postgres + ;; + linux) + export ASAN_OPTIONS="detect_leaks=0" + if [ "${CC}" = "clang" ] + then + CC=clang-3.6 + fi + ;; + esac + fi install: - pip install --user urllib3[secure] cpp-coveralls @@ -79,13 +146,46 @@ before_script: - psql -U postgres -c 'CREATE DATABASE sbtest' script: - - ./autogen.sh && ./configure --enable-coverage --enable-asan --enable-msan --with-mysql --with-pgsql - - make - - make distcheck - - SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test + - > + if [ -n "$TARGET" ] then + case "$TARGET" in + test) + ./autogen.sh && ./configure --with-mysql --with-pgsql + make -j2 + SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test + ;; + distcheck) + ./autogen.sh && ./configure --without-mysql + make distcheck + ;; + coverage) + ./autogen.sh && ./configure --enable-coverage --enable-asan --enable-msan --with-mysql --with-pgsql + make -j2 + SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test + ;; + esac + else + git clone https://github.com/packpack/packpack.git packpack + packpack/packpack + fi + +deploy: + # Deploy packages to PackageCloud + - provider: packagecloud + username: "${PACKAGECLOUD_USER}" + repository: "${PACKAGECLOUD_REPO}" + token: "${PACKAGECLOUD_TOKEN}" + dist: "${OS}/${DIST}" + package_glob: build/*.{rpm,deb,dsc} + skip_cleanup: true + on: + condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}" after_success: - - coveralls --exclude third_party/ --gcov-options '\-lp' + - > + if [ "x$TARGET" = "xcoverage" ] then + coveralls --exclude third_party/ --gcov-options '\-lp' + fi # Local variables: # mode: yaml