From ca87553ec76febf332ddba66542258c3320ededb Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 30 Jul 2020 13:47:53 +0200 Subject: [PATCH 1/7] Add a .gitattributes file --- .gitattributes | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b93029b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/phpcs.xml export-ignore From 09a8b73171e09a3d8fc765341979e11e5933c0a0 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 30 Jul 2020 13:48:06 +0200 Subject: [PATCH 2/7] Refactor TravisCI file --- .travis.yml | 67 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index e4c6453..5bc3086 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,52 @@ -sudo: false +dist: xenial language: php +stages: + - name: "Lint" + - name: "PHP Unit tests" + cache: directories: - - $HOME/.composer/cache - - $HOME/.local - - vendor - -matrix: - fast_finish: true - include: - - php: 7.1 - env: - - EXECUTE_CS_CHECK=true - - EXECUTE_TEST_COVERALLS=true - - PATH="$HOME/.local/bin:$PATH" - - php: nightly - allow_failures: - - php: nightly - -before_install: - - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - - composer self-update - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:dev-master ; fi + - $HOME/.composer/cache/ install: - - travis_retry composer install --no-interaction - - composer info -i + - composer install --no-interaction script: - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi - - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then vendor/bin/phpunit ; fi - - if [[ $EXECUTE_CS_CHECK == 'true' ]]; then vendor/bin/phpcs ; fi + - ./vendor/bin/phpunit --coverage-clover clover.xml + +after_success: + - bash <(curl -s https://codecov.io/bash) + +jobs: + allow_failures: + - php: nightly -after_script: - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then vendor/bin/coveralls ; fi + include: + - stage: "Lint" + name: "Lint files" + before_install: phpenv config-rm xdebug.ini + after_success: skip + script: ./vendor/bin/phpcs + + - stage: "PHP Unit tests" + php: 7.1 + name: "PHP 7.1" + - stage: "PHP Unit tests" + php: 7.2 + name: "PHP 7.2" + - stage: "PHP Unit tests" + php: 7.3 + name: "PHP 7.3" + - stage: "PHP Unit tests" + php: 7.4 + name: "PHP 7.4" + - stage: "PHP Unit tests" + php: nightly + name: "PHP nightly" + install: + - composer install --no-interaction --ignore-platform-reqs notifications: email: true From 69408071eb44c1fc7734246e385dd43950cb56fa Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 30 Jul 2020 13:48:17 +0200 Subject: [PATCH 3/7] Upgrade squizlabs/php_codesniffer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 41184d3..8562b62 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ ], "require-dev": { "phpunit/phpunit": "^6.4", - "squizlabs/php_codesniffer": "^3.1" + "squizlabs/php_codesniffer": "^3.4" }, "autoload": { "psr-4": { From a97f482ab06ae09280575680bf6e9e0e0bea03d2 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 30 Jul 2020 13:49:04 +0200 Subject: [PATCH 4/7] Sync author block with baconqrcode --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8562b62..dfaac02 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,9 @@ "authors": [ { "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", "homepage": "https://dasprids.de/", - "email": "mail@dasprids.de" + "role": "Developer" } ], "keywords": [ From 2e638db023b0d0e196461888ca6527cfcf230354 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 30 Jul 2020 13:49:30 +0200 Subject: [PATCH 5/7] Upgrade phpunit/phpunit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dfaac02..b3d745a 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "map" ], "require-dev": { - "phpunit/phpunit": "^6.4", + "phpunit/phpunit": "^7 | ^8 | ^9", "squizlabs/php_codesniffer": "^3.4" }, "autoload": { From 588a9c76da37b1365288938066289c70beaeeca3 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 30 Jul 2020 13:50:20 +0200 Subject: [PATCH 6/7] Fix setUp method signature for phpunit --- test/AbstractEnumTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/AbstractEnumTest.php b/test/AbstractEnumTest.php index ddba7d3..58ca913 100644 --- a/test/AbstractEnumTest.php +++ b/test/AbstractEnumTest.php @@ -14,7 +14,7 @@ final class AbstractEnumTest extends TestCase { - public function setUp() + public function setUp(): void { $reflectionClass = new ReflectionClass(AbstractEnum::class); From cfe931117dd14d15e8b4a5c645a34f163d9112b2 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 30 Jul 2020 13:57:42 +0200 Subject: [PATCH 7/7] Switch to coveralls --- .coveralls.yml | 2 -- .travis.yml | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index bc71b62..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -coverage_clover: clover.xml -json_path: coveralls-upload.json diff --git a/.travis.yml b/.travis.yml index 5bc3086..319d024 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,9 @@ script: - ./vendor/bin/phpunit --coverage-clover clover.xml after_success: - - bash <(curl -s https://codecov.io/bash) + - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar + - chmod +x php-coveralls.phar + - php php-coveralls.phar --verbose --coverage_clover clover.xml --json_path coveralls-upload.json jobs: allow_failures: