From 33153b8f3a2e4974ae5b1e9f4017f669e35207fe Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sat, 22 Oct 2016 22:43:25 +0200 Subject: [FEATURE] :construction_worker: Extend Travis CI integration. Testing several Travis CI features. Add DBs to travis execution matrix. Doxygen API docu generation and deployment to gh-pages. Update phpunit to 5.7. --- .travis.yml | 133 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 108 insertions(+), 25 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 3570fe411..6938033ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,44 +1,127 @@ +# +# Travis-CI configuration file +# +## configure things +# + # see http://about.travis-ci.org/docs/user/languages/php/ for more hints language: php -# list any PHP version you want to test against -php: - # using major version aliases +# use docker based containers +sudo: false + +# Git branches whitelist to build on Travis CI +branches: + only: + - master + - dev - # aliased to a recent 5.6.x version - - 5.6 - # aliased to a recent 7.x version - - 7.0 - # aliased to a recent hhvm version - - hhvm +# Install additional software +addons: + # Install dependencies for generating API documentation with doxygen + apt: + packages: + - doxygen + - doxygen-latex + - graphviz + - ttf-liberation -# optionally specify a list of environments, for example to test different RDBMS -#env: -# - DB=mysql -# - DB=pgsql +# enable and start databases? +#services: +# - mariadb +# - postgresql + +# any PHP version we want to test against, our unit tests require PHP>=5.6 +php: + - '5.6' + - '7.0' + #- hhvm -# optionally set up exclutions and allowed failures in the matrix +# list of environments to test +env: + global: + # used for doxygen deployment script + - DOXYFILE: $TRAVIS_BUILD_DIR/util/Doxyfile + - GHP_REPO_REF: github.com/redmatrix/hubzilla.git + # Uncomment if a newer/specific version of Doxygen should be used + #- DOXY_VER: 1.8.12 + # use matrix only for PHP and MySQL, all other combinations added through includes + matrix: + - DB=mysql + +# Matrix configuration details matrix: + fast_finish: true + # Additional check combinations + include: + # PHP7, mariadb 10.1 + - php: '7.0' + env: DB=mariadb MARIADB_VERSION=10.1 + # use mariadb instead of MySQL + addons: + mariadb: '10.1' + # PHP7, PostgreSQL 9.4 + - php: '7.0' + env: DB=pgsql POSTGRESQL_VERSION=9.4 + # Use newer postgres than 9.1 default + addons: + postgresql: '9.4' + # Exclude from default matrix combinations # exclude: # - php: hhvm # env: DB=pgsql # PDO driver for pgsql is unsupported by HHVM (3rd party install for support) - allow_failures: - - php: hhvm -# execute any number of scripts before the test run, custom env's are available as variables -#before_script: -# - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS hello_world_test;" -U postgres; fi -# - if [[ "$DB" == "pgsql" ]]; then psql -c "create database hello_world_test;" -U postgres; fi -# - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS hello_world_test;" -uroot; fi +# cache composer downloads between runs +cache: + directories: + - $HOME/.composer/cache + + +# +## execute things +# + +before_install: + - travis_retry composer self-update + +# Install composer dev libs install: - - composer install --optimize-autoloader + - travis_retry composer install --optimize-autoloader + +# execute any number of scripts before the test run, custom env's are available as variables +before_script: + # Some preparation tasks of environment + - ./tests/travis/prepare.sh + # DB specific prepare scripts + - if [[ "$DB" == "mysql" ]]; then ./tests/travis/prepare_mysql.sh; fi + - if [[ "$DB" == "mariadb" ]]; then ./tests/travis/prepare_mysql.sh; fi + - if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi # omitting "script:" will default to phpunit -# use the $DB env variable to determine the phpunit.xml to use -script: vendor/bin/phpunit tests/unit/ +script: ./vendor/bin/phpunit -c tests/phpunit-$DB.xml + +after_success: + # Generate API documentation and deploy it to gh-pages + - ./tests/travis/gen_apidocs.sh +#after_failure: + +# Deploying a release to GitHub when tagging in master +# Waiting for upcoming 'Build Stages' Q1/Q2 2017 to make generation of API docs +# and release packages cleaner. https://github.com/travis-ci/travis-ci/issues/929 +#before_deploy: +#deploy: +# skip_cleaning: true +# provider: releases +# on: +# tags: true +#after_deploy: + +#after_script: + + # configure notifications (email, IRC, campfire etc) -notifications: +#notifications: # irc: "irc.freenode.org#yourfavouriteroomfortravis" # a plugin/script to post to a hubzilla channel would be neat here -- cgit v1.2.3 From 03db9833e833959bb2414b736fddb967763d0d4f Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sun, 6 Nov 2016 21:31:02 +0100 Subject: :green_heart: Update Travis CI's Doxygen. Travis CI has Doxygen 1.7. We need 1.8 to generate our API documentation. Get a static version and use it. Always build API Documentation, but changed Doxygen configuration to only print out errors in the documentation generation, so these can be reviewed. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 6938033ce..1412390ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,9 @@ addons: # Install dependencies for generating API documentation with doxygen apt: packages: - - doxygen - - doxygen-latex + # default doxygen 1.7 is too old, we install our own + #- doxygen + #- doxygen-latex - graphviz - ttf-liberation @@ -75,6 +76,7 @@ matrix: cache: directories: - $HOME/.composer/cache + - $HOME/doxygen/doxygen-$DOXY_VER/bin -- cgit v1.2.3 From 8e80500ee68972eef7d9c004823d1a547270334f Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Mon, 5 Dec 2016 20:23:59 +0100 Subject: :construction_worker: use PHP7.1 and add PostgreSQL9.6 Use newer distro for Travis CI runs. New environment provides PostgreSQL9.6. Also no need to install custom Doxygen, made it optional. Changed default PHP environment from PHP7.0 to current PHP7.1. Changed codecoverage reporting. --- .travis.yml | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 1412390ab..4fac4246a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ # -# Travis-CI configuration file +# Travis-CI configuration file for Hubzilla # ## configure things # @@ -7,6 +7,8 @@ # see http://about.travis-ci.org/docs/user/languages/php/ for more hints language: php +# use newer 'trusty' based distro, old one is 'precise' +dist: trusty # use docker based containers sudo: false @@ -21,9 +23,8 @@ addons: # Install dependencies for generating API documentation with doxygen apt: packages: - # default doxygen 1.7 is too old, we install our own - #- doxygen - #- doxygen-latex + - doxygen + - doxygen-latex - graphviz - ttf-liberation @@ -36,7 +37,8 @@ addons: php: - '5.6' - '7.0' - #- hhvm + - '7.1' + #- 'hhvm' # list of environments to test env: @@ -46,6 +48,8 @@ env: - GHP_REPO_REF: github.com/redmatrix/hubzilla.git # Uncomment if a newer/specific version of Doxygen should be used #- DOXY_VER: 1.8.12 + # Code Coverage is slow, no need to have it in every build + - PHPUCOV: "--no-coverage" # use matrix only for PHP and MySQL, all other combinations added through includes matrix: - DB=mysql @@ -55,18 +59,20 @@ matrix: fast_finish: true # Additional check combinations include: - # PHP7, mariadb 10.1 - - php: '7.0' - env: DB=mariadb MARIADB_VERSION=10.1 + # PHP7.1, mariadb 10.1 + - php: '7.1' + env: DB=mariadb MARIADB_VERSION=10.1 CODECOV=1 # use mariadb instead of MySQL addons: mariadb: '10.1' - # PHP7, PostgreSQL 9.4 - - php: '7.0' - env: DB=pgsql POSTGRESQL_VERSION=9.4 - # Use newer postgres than 9.1 default + # PHP7.1, PostgreSQL 9.6 + - php: '7.1' + env: DB=pgsql POSTGRESQL_VERSION=9.6 + # Use newer postgres than 9.2 default addons: - postgresql: '9.4' + postgresql: '9.6' + services: + - postgresql # Exclude from default matrix combinations # exclude: # - php: hhvm @@ -76,7 +82,7 @@ matrix: cache: directories: - $HOME/.composer/cache - - $HOME/doxygen/doxygen-$DOXY_VER/bin + #- $HOME/doxygen/doxygen-$DOXY_VER/bin @@ -93,6 +99,10 @@ install: # execute any number of scripts before the test run, custom env's are available as variables before_script: + # Use code coverage config for phpunit + - if [[ ! -z $CODECOV ]]; then export PHPUCOV=""; fi + # HHVM needs xdebug for code coverage, but extremely slow + #- if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'xdebug.enable = On' >> /etc/hhvm/php.ini; fi # Some preparation tasks of environment - ./tests/travis/prepare.sh # DB specific prepare scripts @@ -101,7 +111,7 @@ before_script: - if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi # omitting "script:" will default to phpunit -script: ./vendor/bin/phpunit -c tests/phpunit-$DB.xml +script: ./vendor/bin/phpunit $PHPUCOV -c tests/phpunit-$DB.xml after_success: # Generate API documentation and deploy it to gh-pages -- cgit v1.2.3 From cb2eee1d2e82be62118482fb2668561c193a012b Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Fri, 27 Jan 2017 21:56:21 +0100 Subject: :construction_worker: Add old MySQL 5.5 to Travis CI again. The trusty distro contains MySQL 5.6. Add a precise distro with MySQL 5.5. Unfortunately 5.7 is not yet provided, which would be interesting because of the enabled strict SQL mode. --- .travis.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 4fac4246a..323c48f7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ addons: - graphviz - ttf-liberation -# enable and start databases? +# enable and start databases on a per job basis #services: # - mariadb # - postgresql @@ -52,7 +52,8 @@ env: - PHPUCOV: "--no-coverage" # use matrix only for PHP and MySQL, all other combinations added through includes matrix: - - DB=mysql + # trusty default MySQL 5.6 + - DB=mysql MYSQL_VERSION=5.6 # Matrix configuration details matrix: @@ -73,7 +74,13 @@ matrix: postgresql: '9.6' services: - postgresql - # Exclude from default matrix combinations + # PHP7.1, old precise distribution with MySQL 5.5 + - php: '7.1' + env: DB=mysql MYSQL_VERSION=5.5 + dist: precise + services: + - mysql + # Excludes from default matrix combinations # exclude: # - php: hhvm # env: DB=pgsql # PDO driver for pgsql is unsupported by HHVM (3rd party install for support) -- cgit v1.2.3 From 4a85726e5583e7de497077ded4e2ffbcd8b8a0b9 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sun, 5 Feb 2017 01:38:12 +0100 Subject: :construction_worker: :arrow_up: :heavy_plus_sign: Update PHPUnit to current stable 6. Update requirements to PHP7 for dev. Add php-mock-phpunit to mock and stub global functions in a better way. --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 323c48f7f..2d1771c1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,11 +33,11 @@ addons: # - mariadb # - postgresql -# any PHP version we want to test against, our unit tests require PHP>=5.6 +# any PHP version we want to test against, current stable phpunit requires PHP >= 7.0 php: - - '5.6' - '7.0' - '7.1' + # HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet #- 'hhvm' # list of environments to test @@ -108,8 +108,6 @@ install: before_script: # Use code coverage config for phpunit - if [[ ! -z $CODECOV ]]; then export PHPUCOV=""; fi - # HHVM needs xdebug for code coverage, but extremely slow - #- if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'xdebug.enable = On' >> /etc/hhvm/php.ini; fi # Some preparation tasks of environment - ./tests/travis/prepare.sh # DB specific prepare scripts -- cgit v1.2.3 From 5c080ca4e84d9c516d229b8a1248ad5aecf2fe0f Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Fri, 10 Mar 2017 01:01:35 +0100 Subject: :construction_worker: Add Travis' GitHub deployment steps. Changed API documentation deployment to gh_pages to Travis's GitHub Pages deployment. Also add Travis GitHub Release Deployment step to offer API documentation. Both steps are optional and need to be activated in Travis by setting GH_TOKEN. --- .travis.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 2d1771c1b..e1aec9145 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,8 @@ branches: only: - master - dev + # whitelist our tags for release deployments e.g. 2.2 + - /^\d+\.\d+(\.\d+)?(-\S*)?$/ # Install additional software addons: @@ -45,7 +47,6 @@ env: global: # used for doxygen deployment script - DOXYFILE: $TRAVIS_BUILD_DIR/util/Doxyfile - - GHP_REPO_REF: github.com/redmatrix/hubzilla.git # Uncomment if a newer/specific version of Doxygen should be used #- DOXY_VER: 1.8.12 # Code Coverage is slow, no need to have it in every build @@ -123,15 +124,26 @@ after_success: - ./tests/travis/gen_apidocs.sh #after_failure: -# Deploying a release to GitHub when tagging in master -# Waiting for upcoming 'Build Stages' Q1/Q2 2017 to make generation of API docs -# and release packages cleaner. https://github.com/travis-ci/travis-ci/issues/929 +# Deploying release and API documentation to GitHub #before_deploy: -#deploy: -# skip_cleaning: true -# provider: releases -# on: -# tags: true +deploy: + - provider: pages + skip_cleanup: true + local_dir: $TRAVIS_BUILD_DIR/doc/html + github_token: $GH_TOKEN + on: + repo: redmatrix/hubzilla + branch: master + condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")' + # add API documentation to release, could also be used to provide full packages if we want to drop vendor from our repo + - provider: releases + skip_cleanup: true + api_key: $GH_TOKEN + file: 'doc/hubzilla-api-documentation.zip' + on: + repo: redmatrix/hubzilla + tags: true + condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")' #after_deploy: #after_script: -- cgit v1.2.3