From 20b73350fecfefc6034ebcecf61f64fa898ae935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sat, 13 Feb 2021 08:27:05 +0100 Subject: [PATCH] Improve TravisCI configuration - start MySQL database - add all PHP 7.* versions - chronological order - YAML string syntax --- .travis.yml | 59 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 18bbdb52..ec6deafc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,48 @@ -language: php +# TravisCI configuration for WordPress/phpdoc-parser -sudo: false +if: "branch = master" -matrix: +language: "php" +os: + - "linux" +dist: "trusty" + +services: + - mysql + +env: + global: + # Setup WP_TESTS_DIR (needed to bootstrap WP PHPUnit tests). + - WP_TESTS_DIR: "/tmp/wordpress/tests/phpunit/" + +jobs: include: - - php: 7.1 - - php: 7.0 - - php: 5.6 - - php: 5.5 - - php: 5.4 - - php: hhvm + - php: "7.4" + - php: "7.3" + - php: "7.2" + - php: "7.1" + - php: "7.0" + - php: "5.6" + - php: "5.5" + - php: "5.4" + +cache: + directories: + - "${HOME}/.composer/cache" before_install: - # Setup WP_TESTS_DIR (needed to bootstrap WP PHPUnit tests). - - export WP_TESTS_DIR=/tmp/wordpress/tests/phpunit/ # Clone the WordPress develop repo. - - git clone --depth=1 --branch="4.3" git://develop.git.wordpress.org/ /tmp/wordpress/ + - git clone --depth=1 --branch=4.3 git://develop.git.wordpress.org/ /tmp/wordpress/ # Setup DB. - - mysql -e "CREATE DATABASE wordpress_test;" -uroot + - mysql -e "CREATE DATABASE wordpress_test;" -u root # Setup wp-config. - cp /tmp/wordpress/wp-tests-config-sample.php /tmp/wordpress/wp-tests-config.php - - sed -i "s/youremptytestdbnamehere/wordpress_test/" /tmp/wordpress/wp-tests-config.php - - sed -i "s/yourusernamehere/root/" /tmp/wordpress/wp-tests-config.php - - sed -i "s/yourpasswordhere//" /tmp/wordpress/wp-tests-config.php + - sed -i -e "s/youremptytestdbnamehere/wordpress_test/" /tmp/wordpress/wp-tests-config.php + - sed -i -e "s/yourusernamehere/root/" /tmp/wordpress/wp-tests-config.php + - sed -i -e "s/yourpasswordhere//" /tmp/wordpress/wp-tests-config.php -install: composer install --no-dev +install: + - composer install --no-interaction --no-dev script: - - phpunit - -cache: - directories: - - vendor - - $HOME/.composer/cache + - phpunit --verbose