From f6861ad4c05da75063639bc680a588bd00eab16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 20:12:06 +0200 Subject: [PATCH 01/10] Fix failing builds on TravisCI Wrap apt-get update && apt-get install into travis_retry --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c1552bb2a8..a4d96b98c73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -246,8 +246,8 @@ before_script: - echo "Setting up Apache + FPM" - - sudo apt-get update - - sudo apt-get install apache2 libapache2-mod-fastcgi + - travis_retry sudo apt-get update + - travis_retry sudo apt-get install apache2 libapache2-mod-fastcgi # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | From 707dfca7f26f1cc5ed9e6eb403e4d65a8416b4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 20:22:54 +0200 Subject: [PATCH 02/10] pgdg is in the trusted list ; using it instead of custom sourceline. --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a4d96b98c73..99a13924000 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,7 @@ addons: apt: sources: # To use the last version of pgloader, we add repo of postgresql - - postgresql - - sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' - - key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' + - pgdg packages: # We need a webserver to test the webservices # Let's install Apache with. From e64a2d11d6189b23dd3e73cb9ae85d5fd8999853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 20:24:24 +0200 Subject: [PATCH 03/10] No need to re-install apache & libapache2-mod-fastcgi They are already being installed (lines 25 and 27) --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 99a13924000..fefd664e27e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -244,8 +244,6 @@ before_script: - echo "Setting up Apache + FPM" - - travis_retry sudo apt-get update - - travis_retry sudo apt-get install apache2 libapache2-mod-fastcgi # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | From b7bb600d33b929668bc178a33d374cc3b4cc932a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 20:29:14 +0200 Subject: [PATCH 04/10] Trusted source key is pgdg-trusty not pgdg --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fefd664e27e..81654669869 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ addons: apt: sources: # To use the last version of pgloader, we add repo of postgresql - - pgdg + - pgdg-trusty packages: # We need a webserver to test the webservices # Let's install Apache with. From bda05a0e89bb40c1f8d4d93e2b1741c112b2ffd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 20:36:04 +0200 Subject: [PATCH 05/10] Speedup Composer dependencies install (downloads packages in parallel) --- .travis.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81654669869..eeaa7e9a755 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,34 +110,33 @@ install: rm $TRAVIS_BUILD_DIR/composer.json rm $TRAVIS_BUILD_DIR/composer.lock composer self-update + composer global require hirak/prestissimo composer -n init composer -n config vendor-dir htdocs/includes echo - | - echo "Installing Parallel Lint" - composer -n require jakub-onderka/php-parallel-lint ^0 - composer -n require jakub-onderka/php-console-highlighter ^0 - echo - -- | - echo "Installing PHP Unit" + echo "Installing Composer dependencies (PHP Unit, Parallel Lint & PHP CodeSniffer" if [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then - composer -n require phpunit/phpunit ^4 + composer -n require phpunit/phpunit ^4 \ + jakub-onderka/php-parallel-lint ^0 \ + jakub-onderka/php-console-highlighter ^0 \ + squizlabs/php_codesniffer ^3 fi if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then - composer -n require phpunit/phpunit ^5 + composer -n require phpunit/phpunit ^5 \ + jakub-onderka/php-parallel-lint ^0 \ + jakub-onderka/php-console-highlighter ^0 \ + squizlabs/php_codesniffer ^3 fi if [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then - composer -n require phpunit/phpunit ^5 + composer -n require phpunit/phpunit ^5 \ + jakub-onderka/php-parallel-lint ^0 \ + jakub-onderka/php-console-highlighter ^0 \ + squizlabs/php_codesniffer ^3 fi echo -- | - echo "Installing PHP CodeSniffer" - composer -n require squizlabs/php_codesniffer ^3 - echo - - | echo "Adding path of binaries tools installed by composer to the PATH" export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH" From e77799be88ba3a652ef12cde432b51ebf8e1a78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 20:45:19 +0200 Subject: [PATCH 06/10] Running PHP CodeSniffer with multiple process --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eeaa7e9a755..ab80eb3001d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -293,7 +293,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi + if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --parallel=16 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e echo From 00d425e72ef60446056803abd8fb583052f07b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 20:58:06 +0200 Subject: [PATCH 07/10] Running PHP CodeSniffer with multiple process --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ab80eb3001d..b488c438704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -293,7 +293,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --parallel=16 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi + if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --parallel=5 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e echo From f62e0edaaf806828dcaa4263e05c55f3ca7181d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 21:10:15 +0200 Subject: [PATCH 08/10] After testing PHP CodeSniffer with multiple process, it is not faster. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b488c438704..eeaa7e9a755 100644 --- a/.travis.yml +++ b/.travis.yml @@ -293,7 +293,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --parallel=5 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi + if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e echo From 0939ea18bc2946e3e779afc4fd96d1447e86afee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= Date: Fri, 30 Aug 2019 21:17:56 +0200 Subject: [PATCH 09/10] Ignore Composer platform requirements for PHP nightly --- .travis.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index eeaa7e9a755..3e8cb903cfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,18 +123,19 @@ install: jakub-onderka/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 fi - if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then - composer -n require phpunit/phpunit ^5 \ - jakub-onderka/php-parallel-lint ^0 \ - jakub-onderka/php-console-highlighter ^0 \ - squizlabs/php_codesniffer ^3 - fi - if [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then + if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \ + [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ]; then composer -n require phpunit/phpunit ^5 \ jakub-onderka/php-parallel-lint ^0 \ jakub-onderka/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 fi + if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then + composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \ + jakub-onderka/php-parallel-lint ^0 \ + jakub-onderka/php-console-highlighter ^0 \ + squizlabs/php_codesniffer ^3 + fi echo - | From 132aceaa2085ba7aeca628bbd821bcba2aeaf9ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 15:35:06 +0200 Subject: [PATCH 10/10] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3e8cb903cfb..cccc1efe1c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,6 +110,7 @@ install: rm $TRAVIS_BUILD_DIR/composer.json rm $TRAVIS_BUILD_DIR/composer.lock composer self-update + # To have composer making parallel downloads composer global require hirak/prestissimo composer -n init composer -n config vendor-dir htdocs/includes