From 8e2b7f26f2418c1838cdca430ad58285f9cf9b39 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 17:40:04 +0300 Subject: [PATCH 01/15] create test CI config --- .github/workflows/test.yaml | 88 +++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..c248957 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,88 @@ +name: Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }} + + runs-on: ubuntu-latest + + continue-on-error: ${{ matrix.allowed-to-fail }} + + strategy: + matrix: + php-version: + - '5.5' + - '5.6' + - '7.0' + - '7.1' + - '7.2' + - '7.3' + - '7.4' + dependencies: [highest] + allowed-to-fail: [false] + variant: [normal] + include: + - php-version: '5.5' + dependencies: lowest + allowed-to-fail: false + variant: normal + - php-version: '8.0' + dependencies: highest + allowed-to-fail: true + variant: normal + - php-version: '5.5' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"2.7.*"' + - php-version: '5.5' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"2.8.*"' + - php-version: '5.5' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"3.4.*"' + - php-version: '7.1' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"4.4.*" phpunit/phpunit:"5.7.*"' + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: pcov + tools: composer:v2 + + - name: Install variant + if: matrix.variant != 'normal' + run: composer require ${{ matrix.variant }} --no-update + + - name: "Install Composer dependencies (${{ matrix.dependencies }})" + uses: "ramsey/composer-install@v1" + with: + dependency-versions: "${{ matrix.dependencies }}" + composer-options: "--prefer-dist --prefer-stable" + + - name: Run Tests + run: vendor/bin/phpunit --coverage-clover build/coverage-clover.xml + + - name: Send coverage to Scrutinizer CI + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover build/coverage-clover.xml + + - name: Send coverage to Coveralls + run: | + wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar + php php-coveralls.phar -v -c .coveralls.yml From 8ff746c467f860d0097c6c856db35245cf8e9d90 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 18:11:02 +0300 Subject: [PATCH 02/15] add php extensions zlib --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c248957..3e7a331 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -63,6 +63,7 @@ jobs: php-version: ${{ matrix.php-version }} coverage: pcov tools: composer:v2 + extensions: zlib - name: Install variant if: matrix.variant != 'normal' From e6695613976cbeabb749b30aa84c761ff95397e7 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 18:11:17 +0300 Subject: [PATCH 03/15] change max-parallel => 6 --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3e7a331..25af5d6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,6 +15,7 @@ jobs: continue-on-error: ${{ matrix.allowed-to-fail }} strategy: + max-parallel: 6 matrix: php-version: - '5.5' From 12df08ec03333913b0f5e49e4fd790708f408ea7 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 18:25:35 +0300 Subject: [PATCH 04/15] disable .travis.yml --- .travis.yml => _.travis.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .travis.yml => _.travis.yml (100%) diff --git a/.travis.yml b/_.travis.yml similarity index 100% rename from .travis.yml rename to _.travis.yml From 63067e765f61ea6732984a01a60bb14d4b9af0ee Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 18:26:33 +0300 Subject: [PATCH 05/15] minimum jobs --- .github/workflows/test.yaml | 78 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 25af5d6..de68a35 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,41 +18,41 @@ jobs: max-parallel: 6 matrix: php-version: - - '5.5' - - '5.6' - - '7.0' - - '7.1' +# - '5.5' +# - '5.6' +# - '7.0' +# - '7.1' - '7.2' - '7.3' - '7.4' dependencies: [highest] allowed-to-fail: [false] variant: [normal] - include: - - php-version: '5.5' - dependencies: lowest - allowed-to-fail: false - variant: normal - - php-version: '8.0' - dependencies: highest - allowed-to-fail: true - variant: normal - - php-version: '5.5' - dependencies: highest - allowed-to-fail: false - variant: 'symfony/symfony:"2.7.*"' - - php-version: '5.5' - dependencies: highest - allowed-to-fail: false - variant: 'symfony/symfony:"2.8.*"' - - php-version: '5.5' - dependencies: highest - allowed-to-fail: false - variant: 'symfony/symfony:"3.4.*"' - - php-version: '7.1' - dependencies: highest - allowed-to-fail: false - variant: 'symfony/symfony:"4.4.*" phpunit/phpunit:"5.7.*"' +# include: +# - php-version: '5.5' +# dependencies: lowest +# allowed-to-fail: false +# variant: normal +# - php-version: '8.0' +# dependencies: highest +# allowed-to-fail: true +# variant: normal +# - php-version: '5.5' +# dependencies: highest +# allowed-to-fail: false +# variant: 'symfony/symfony:"2.7.*"' +# - php-version: '5.5' +# dependencies: highest +# allowed-to-fail: false +# variant: 'symfony/symfony:"2.8.*"' +# - php-version: '5.5' +# dependencies: highest +# allowed-to-fail: false +# variant: 'symfony/symfony:"3.4.*"' +# - php-version: '7.1' +# dependencies: highest +# allowed-to-fail: false +# variant: 'symfony/symfony:"4.4.*" phpunit/phpunit:"5.7.*"' steps: - name: Checkout @@ -78,13 +78,13 @@ jobs: - name: Run Tests run: vendor/bin/phpunit --coverage-clover build/coverage-clover.xml - - - name: Send coverage to Scrutinizer CI - run: | - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/coverage-clover.xml - - - name: Send coverage to Coveralls - run: | - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar - php php-coveralls.phar -v -c .coveralls.yml +# +# - name: Send coverage to Scrutinizer CI +# run: | +# wget https://scrutinizer-ci.com/ocular.phar +# php ocular.phar code-coverage:upload --format=php-clover build/coverage-clover.xml +# +# - name: Send coverage to Coveralls +# run: | +# wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar +# php php-coveralls.phar -v -c .coveralls.yml From 6f56afe52d760dc5c3675f4326b4b13be9dd729d Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 18:49:01 +0300 Subject: [PATCH 06/15] uncomment several jobs --- .github/workflows/test.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index de68a35..7163446 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,10 +18,10 @@ jobs: max-parallel: 6 matrix: php-version: -# - '5.5' -# - '5.6' -# - '7.0' -# - '7.1' + - '5.5' + - '5.6' + - '7.0' + - '7.1' - '7.2' - '7.3' - '7.4' @@ -78,13 +78,13 @@ jobs: - name: Run Tests run: vendor/bin/phpunit --coverage-clover build/coverage-clover.xml -# -# - name: Send coverage to Scrutinizer CI -# run: | -# wget https://scrutinizer-ci.com/ocular.phar -# php ocular.phar code-coverage:upload --format=php-clover build/coverage-clover.xml -# -# - name: Send coverage to Coveralls -# run: | -# wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar -# php php-coveralls.phar -v -c .coveralls.yml + + - name: Send coverage to Scrutinizer CI + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover build/coverage-clover.xml + + - name: Send coverage to Coveralls + run: | + wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar + php php-coveralls.phar -v -c .coveralls.yml From 619814732561c98c6c0cb3fa5ac91bf9eab5bf00 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 18:52:05 +0300 Subject: [PATCH 07/15] use xdebug for coverage --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7163446..216258d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -62,7 +62,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - coverage: pcov + coverage: xdebug tools: composer:v2 extensions: zlib From 19414111c22a1d05ebc2c52815d87e56819cfc8b Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 18:58:33 +0300 Subject: [PATCH 08/15] add bz2 PHP extension --- .github/workflows/test.yaml | 2 +- composer.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 216258d..e136b13 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -64,7 +64,7 @@ jobs: php-version: ${{ matrix.php-version }} coverage: xdebug tools: composer:v2 - extensions: zlib + extensions: zlib, bz2 - name: Install variant if: matrix.variant != 'normal' diff --git a/composer.json b/composer.json index 0a265f2..03b8fe5 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,8 @@ "php": ">=5.5.0" }, "require-dev": { + "ext-zlib": "*", + "ext-bz2": "*", "psr/log": "~1.0", "gpslab/compressor": "~1.0", "symfony/console": "~2.4|~3.0|~4.0", From fd36d2146b2fe0909266e9571fd57a3dc5eebeda Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 19:09:17 +0300 Subject: [PATCH 09/15] change configuration of Coveralls command --- .github/workflows/test.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e136b13..638fcab 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,12 +79,14 @@ jobs: - name: Run Tests run: vendor/bin/phpunit --coverage-clover build/coverage-clover.xml - - name: Send coverage to Scrutinizer CI + - name: Send coverage results to Scrutinizer CI run: | wget https://scrutinizer-ci.com/ocular.phar php ocular.phar code-coverage:upload --format=php-clover build/coverage-clover.xml - - name: Send coverage to Coveralls + - name: Send coverage results to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar - php php-coveralls.phar -v -c .coveralls.yml + composer global require php-coveralls/php-coveralls + php-coveralls --coverage_clover=build/coverage-clover.xml -v -c .coveralls.yml From ce0f2db3dda286b453f9b75e427ac218887a29c3 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 19:20:58 +0300 Subject: [PATCH 10/15] uncomment jobs with custom symfony version --- .github/workflows/test.yaml | 54 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 638fcab..6944d12 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,9 +2,9 @@ name: Test on: push: - branches: [ master ] + branches: pull_request: - branches: [ master ] + branches: jobs: test: @@ -28,31 +28,31 @@ jobs: dependencies: [highest] allowed-to-fail: [false] variant: [normal] -# include: -# - php-version: '5.5' -# dependencies: lowest -# allowed-to-fail: false -# variant: normal -# - php-version: '8.0' -# dependencies: highest -# allowed-to-fail: true -# variant: normal -# - php-version: '5.5' -# dependencies: highest -# allowed-to-fail: false -# variant: 'symfony/symfony:"2.7.*"' -# - php-version: '5.5' -# dependencies: highest -# allowed-to-fail: false -# variant: 'symfony/symfony:"2.8.*"' -# - php-version: '5.5' -# dependencies: highest -# allowed-to-fail: false -# variant: 'symfony/symfony:"3.4.*"' -# - php-version: '7.1' -# dependencies: highest -# allowed-to-fail: false -# variant: 'symfony/symfony:"4.4.*" phpunit/phpunit:"5.7.*"' + include: + - php-version: '5.5' + dependencies: lowest + allowed-to-fail: false + variant: normal + - php-version: '8.0' + dependencies: highest + allowed-to-fail: true + variant: normal + - php-version: '5.5' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"2.7.*"' + - php-version: '5.5' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"2.8.*"' + - php-version: '5.5' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"3.4.*"' + - php-version: '7.1' + dependencies: highest + allowed-to-fail: false + variant: 'symfony/symfony:"4.4.*" phpunit/phpunit:"5.7.*"' steps: - name: Checkout From 0ec4e08b257f4e584f3b24dd5f4470780cec0a46 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 19:30:18 +0300 Subject: [PATCH 11/15] add "Quality assurance" test --- .github/workflows/qa.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/qa.yaml diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml new file mode 100644 index 0000000..dff0f31 --- /dev/null +++ b/.github/workflows/qa.yaml @@ -0,0 +1,34 @@ +name: Quality assurance + +on: + push: + pull_request: + +jobs: + phpstan: + name: PHPStan + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: 7.1 + coverage: none + tools: composer:v2 + + - name: Install variant + run: composer require phpstan/phpstan:"0.12.*" --no-update + + - name: Install Composer dependencies (highest) + uses: "ramsey/composer-install@v1" + with: + dependency-versions: "highest" + composer-options: "--prefer-dist --prefer-stable" + + - name: PHPStan + run: vendor/bin/phpstan --memory-limit=1G analyse From 36c80b61b68ab305cf6e0a035fb9beed2155411b Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 19:33:57 +0300 Subject: [PATCH 12/15] configure variant for PHP 8 --- .github/workflows/test.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6944d12..4b5999d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,14 +29,10 @@ jobs: allowed-to-fail: [false] variant: [normal] include: - - php-version: '5.5' - dependencies: lowest - allowed-to-fail: false - variant: normal - php-version: '8.0' dependencies: highest allowed-to-fail: true - variant: normal + variant: 'phpunit/phpunit:"5.7.*"' - php-version: '5.5' dependencies: highest allowed-to-fail: false From ae0e8cd78d7556012b0b10c371089e19db26d6a0 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 19:38:20 +0300 Subject: [PATCH 13/15] disable Travis CI --- README.md | 1 - _.travis.yml | 73 ---------------------------------------------------- 2 files changed, 74 deletions(-) delete mode 100644 _.travis.yml diff --git a/README.md b/README.md index f42a18a..7c868f2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ [![Latest Stable Version](https://img.shields.io/packagist/v/gpslab/sitemap.svg?maxAge=3600&label=stable)](https://packagist.org/packages/gpslab/sitemap) -![PHP from Travis config](https://img.shields.io/travis/php-v/gpslab/sitemap.svg?maxAge=3600) [![Build Status](https://img.shields.io/travis/gpslab/sitemap.svg?maxAge=3600)](https://travis-ci.org/gpslab/sitemap) [![Coverage Status](https://img.shields.io/coveralls/gpslab/sitemap.svg?maxAge=3600)](https://coveralls.io/github/gpslab/sitemap?branch=master) [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/gpslab/sitemap.svg?maxAge=3600)](https://scrutinizer-ci.com/g/gpslab/sitemap/?branch=master) diff --git a/_.travis.yml b/_.travis.yml deleted file mode 100644 index 210f924..0000000 --- a/_.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -language: php - -os: linux - -branches: - except: - - /^analysis-.*$/ - -before_install: - - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - - if [ -n "$SYMFONY_VERSION" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --dev --no-update; fi; - - if [ -n "$PHPUNIT_VERSION" ]; then composer require "phpunit/phpunit:${PHPUNIT_VERSION}" --dev --no-update; fi; - - if [ -n "$PHPSTAN_VERSION" ]; then composer require "phpstan/phpstan:${PHPSTAN_VERSION}" --dev --no-update; fi; - -install: COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist --no-interaction --no-scripts --no-progress - -script: - - vendor/bin/phpunit --coverage-clover build/coverage-clover.xml - - wget https://scrutinizer-ci.com/ocular.phar - - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar - - php ocular.phar code-coverage:upload --format=php-clover build/coverage-clover.xml - - php php-coveralls.phar -v -c .coveralls.yml - -jobs: - include: - - stage: Test - php: 5.5 - dist: trusty - - - stage: Test - php: 5.6 - - - stage: Test - php: 7.0 - - - stage: Test - php: 7.1 - - - stage: Test - php: 7.2 - - - stage: Test - php: 7.3 - - - stage: Test - name: Symfony compatible - php: 5.5 - dist: trusty - env: SYMFONY_VERSION=2.7.* - - - stage: Test - name: Symfony compatible - php: 5.5 - dist: trusty - env: SYMFONY_VERSION=2.8.* - - - stage: Test - name: Symfony compatible - php: 5.5 - dist: trusty - env: SYMFONY_VERSION=3.4.* - - - stage: Test - name: Symfony compatible - php: 7.1 - env: SYMFONY_VERSION=4.4.* PHPUNIT_VERSION=5.7.* - - - stage: Code Quality - name: PHPStan - php: 7.1 - dist: trusty - env: PHPSTAN_VERSION=0.12.* - script: vendor/bin/phpstan analyse From afae8c5b56c51ab02f0d4dc65622bf7a81cf16f7 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 19:41:26 +0300 Subject: [PATCH 14/15] try use phpunit 8.5 for PHP 8 --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4b5999d..1ef888f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: - php-version: '8.0' dependencies: highest allowed-to-fail: true - variant: 'phpunit/phpunit:"5.7.*"' + variant: 'phpunit/phpunit:"8.5.*"' - php-version: '5.5' dependencies: highest allowed-to-fail: false From 244b1bb477e5527f22fa1f0c036b6afbe354d356 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 30 Nov 2020 20:16:40 +0300 Subject: [PATCH 15/15] is not compatible with phpunit 8.5 in PHP 8 --- .github/workflows/test.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1ef888f..1533b30 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,10 +29,6 @@ jobs: allowed-to-fail: [false] variant: [normal] include: - - php-version: '8.0' - dependencies: highest - allowed-to-fail: true - variant: 'phpunit/phpunit:"8.5.*"' - php-version: '5.5' dependencies: highest allowed-to-fail: false