From 2f4211dc213e95e00541eeb8451c52644f2a487c Mon Sep 17 00:00:00 2001 From: codemasher Date: Wed, 6 Nov 2019 15:42:06 +0100 Subject: [PATCH 1/8] :octocat: dependency update --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7376414c5..c7d65d90e 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,10 @@ "ext-gd": "*", "ext-json": "*", "ext-mbstring": "*", - "chillerlan/php-settings-container": "^1.1" + "chillerlan/php-settings-container": "^1.2" }, "require-dev": { - "phpunit/phpunit": "^8.3" + "phpunit/phpunit": "^8.4" }, "suggest": { "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps." From a38e677fbf5261da779d3aed802af747ca7afcb2 Mon Sep 17 00:00:00 2001 From: codemasher Date: Fri, 15 Nov 2019 23:21:06 +0100 Subject: [PATCH 2/8] :sparkles: github actions --- .github/workflows/tests.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..9a023ba6f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,40 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +on: + pull_request: + push: + branches: + - master + tags: + - "**" + +name: "PHPUnit tests" + +jobs: + + tests: + name: "Tests" + + runs-on: ubuntu-latest + + strategy: + matrix: + php-binary: + - php7.2 + - php7.3 +# - php7.4 + + steps: + - name: "Checkout" + uses: actions/checkout@v1.1.0 + + - name: "Install dependencies with composer" + run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --prefer-source --no-progress --no-suggest + + - name: "Run unit tests with phpunit/phpunit" + run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml + +# - name: "Send code coverage report to Codecov.io" +# env: +# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +# run: bash <(curl -s https://codecov.io/bash) From 9b9588d99d6d0117e6350ae85f96b6f3301400af Mon Sep 17 00:00:00 2001 From: codemasher Date: Sat, 16 Nov 2019 12:49:52 +0100 Subject: [PATCH 3/8] :octocat: --- .github/workflows/tests.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a023ba6f..9c69d7888 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,6 @@ # https://help.github.com/en/categories/automating-your-workflow-with-github-actions +# https://github.com/localheinz/php-library-template/blob/master/.github/workflows/continuous-integration.yml +# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml on: pull_request: @@ -8,13 +10,12 @@ on: tags: - "**" -name: "PHPUnit tests" +name: "Continuous Integration" jobs: tests: - name: "Tests" - + name: "Unit Tests" runs-on: ubuntu-latest strategy: @@ -24,17 +25,26 @@ jobs: - php7.3 # - php7.4 + dependencies: + - lowest +# - locked + - highest + steps: - name: "Checkout" uses: actions/checkout@v1.1.0 - - name: "Install dependencies with composer" - run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --prefer-source --no-progress --no-suggest + - name: "Install lowest dependencies with composer" + if: matrix.dependencies == 'lowest' + run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest - - name: "Run unit tests with phpunit/phpunit" - run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml +# - name: "Install locked dependencies with composer" +# if: matrix.dependencies == 'locked' +# run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest -# - name: "Send code coverage report to Codecov.io" -# env: -# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} -# run: bash <(curl -s https://codecov.io/bash) + - name: "Install highest dependencies with composer" + if: matrix.dependencies == 'highest' + run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest + + - name: "Run unit tests with phpunit" + run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml From e35b6d522dd3adaaa2506e1857f8d1202d11c3e4 Mon Sep 17 00:00:00 2001 From: codemasher Date: Tue, 3 Dec 2019 21:40:25 +0100 Subject: [PATCH 4/8] :sparkles: PHP 7.4 --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9551b6220..0f88070bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,10 @@ matrix: include: - php: 7.2 - php: 7.3 - - php: 7.4snapshot - - php: nightly - allow_failures: - - php: 7.4snapshot - - php: nightly + - php: 7.4 +# - php: nightly +# allow_failures: +# - php: nightly before_install: - pecl channel-update pecl.php.net From 314ac6d5175edc3c963010aaeb09d611d4d7b3ed Mon Sep 17 00:00:00 2001 From: codemasher Date: Tue, 3 Dec 2019 22:25:39 +0100 Subject: [PATCH 5/8] :octocat: ext-gd missing on 7.4 --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0f88070bc..17b7d1f4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,12 @@ matrix: include: - php: 7.2 - php: 7.3 + - php: 7.4snapshot - php: 7.4 # - php: nightly -# allow_failures: + allow_failures: + - php: 7.4snapshot + - php: 7.4 # ext-gd missing https://travis-ci.community/t/add-php-7-4-branch-to-test-against/2179/16 # - php: nightly before_install: From 17cefd035fa6de2aca1e88667ffede71a5379c3b Mon Sep 17 00:00:00 2001 From: codemasher Date: Wed, 4 Dec 2019 18:34:08 +0100 Subject: [PATCH 6/8] :octocat: logging & coverage -> .build --- .github/workflows/tests.yml | 30 +++++++++++++++++++++------ .gitignore | 7 +++---- phpunit.xml | 17 ++++++++------- tests/Output/QROutputTestAbstract.php | 11 +++++++--- 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9c69d7888..e73d8395e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,6 @@ jobs: dependencies: - lowest -# - locked - highest steps: @@ -38,13 +37,32 @@ jobs: if: matrix.dependencies == 'lowest' run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest -# - name: "Install locked dependencies with composer" -# if: matrix.dependencies == 'locked' -# run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest - - name: "Install highest dependencies with composer" if: matrix.dependencies == 'highest' run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest - name: "Run unit tests with phpunit" - run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml + run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml --no-coverage + + + code-coverage: + name: "Code Coverage" + runs-on: ubuntu-latest + + steps: + - name: "Checkout" + uses: actions/checkout@v1.1.0 + + - name: "Install locked dependencies with composer" + run: php7.3 $(which composer) install --no-interaction --no-progress --no-suggest + + - name: "Dump Xdebug filter with phpunit/phpunit" + run: php7.3 vendor/bin/phpunit --configuration=phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php + + - name: "Collect code coverage with Xdebug and phpunit/phpunit" + run: php7.3 vendor/bin/phpunit --configuration=phpunit.xml --prepend=.build/phpunit/xdebug-filter.php + + - name: "Send code coverage report to Codecov.io" + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://codecov.io/bash) diff --git a/.gitignore b/.gitignore index b7d3238f4..6361335f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -vendor -.idea -tests/Output/output_test.* +.build/* +.idea/* +vendor/* composer.lock -*.phpunit.result.cache diff --git a/phpunit.xml b/phpunit.xml index 2a41c5d15..de751fd04 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,13 +1,9 @@ - - @@ -19,4 +15,9 @@ ./tests/ + + + + + diff --git a/tests/Output/QROutputTestAbstract.php b/tests/Output/QROutputTestAbstract.php index 3a44a3349..6cd95d080 100644 --- a/tests/Output/QROutputTestAbstract.php +++ b/tests/Output/QROutputTestAbstract.php @@ -17,11 +17,11 @@ use chillerlan\QRCode\Data\Byte; use chillerlan\QRCode\Output\{QRCodeOutputException, QROutputInterface}; use chillerlan\QRCodeTest\QRTestAbstract; -/** - */ +use function dirname, file_exists, mkdir; + abstract class QROutputTestAbstract extends QRTestAbstract{ - const cachefile = __DIR__.'/output_test.'; + const cachefile = __DIR__.'/../../.build/output_test/test.'; /** * @var \chillerlan\QRCode\Output\QROutputInterface @@ -41,6 +41,11 @@ abstract class QROutputTestAbstract extends QRTestAbstract{ protected function setUp():void{ parent::setUp(); + $buildDir = dirname($this::cachefile); + if(!file_exists($buildDir)){ + mkdir($buildDir, 0777, true); + } + $this->options = new QROptions; $this->setOutputInterface(); } From 77053b81da0820fa204e8c741e74a5ec9e76450f Mon Sep 17 00:00:00 2001 From: codemasher Date: Wed, 4 Dec 2019 18:38:19 +0100 Subject: [PATCH 7/8] :fire: tab/space mix --- phpunit.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index de751fd04..3a9b678d2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,20 +1,20 @@ - - - ./src - - - - - ./tests/ - - +> + + + ./src + + + + + ./tests/ + + From 375a1dce5b43ebb31097d8f23bed052ea1848c34 Mon Sep 17 00:00:00 2001 From: codemasher Date: Wed, 4 Dec 2019 18:46:21 +0100 Subject: [PATCH 8/8] :sparkles: +gh action badge --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ca1ba3e40..539d9d5e1 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ namespaced, cleaned up, improved and other stuff. [![Packagist downloads][downloads-badge]][downloads] [![PayPal donate][donate-badge]][donate] +[![Continuous Integration][gh-action-badge]][gh-action] + [packagist-badge]: https://img.shields.io/packagist/v/chillerlan/php-qrcode.svg?style=flat-square [packagist]: https://packagist.org/packages/chillerlan/php-qrcode [license-badge]: https://img.shields.io/github/license/chillerlan/php-qrcode.svg?style=flat-square @@ -25,6 +27,8 @@ namespaced, cleaned up, improved and other stuff. [downloads]: https://packagist.org/packages/chillerlan/php-qrcode/stats [donate-badge]: https://img.shields.io/badge/donate-paypal-ff33aa.svg?style=flat-square [donate]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WLYUNAT9ZTJZ4 +[gh-action-badge]: https://github.com/chillerlan/php-qrcode/workflows/Continuous%20Integration/badge.svg +[gh-action]: https://github.com/chillerlan/php-qrcode/actions Hi, please check out my other projects that are way cooler than qrcodes!