From 1bd3df79005853137b25117581804ccd4395ef5e Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 21 Dec 2020 18:48:55 +0530 Subject: [PATCH 1/2] Switch to GA workflow --- .gitattributes | 6 ++-- .github/workflows/ci.yml | 77 ++++++++++++++++++++++++++++++++++++++++ .scrutinizer.yml | 21 ----------- .travis.yml | 46 ------------------------ README.md | 2 +- 5 files changed, 81 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .scrutinizer.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index 6d2ed281..5bb8534b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,13 +4,13 @@ CONTRIBUTING.md export-ignore .gitattributes export-ignore .gitignore export-ignore phpunit.xml.dist export-ignore -.travis.yml export-ignore -.scrutinizer.yml export-ignore +.sticker.yml export-ignore tests export-ignore docs export-ignore .github export-ignore -.coveralls.yml export-ignore Makefile export-ignore phpstan.neon export-ignore phpstan-baseline.neon export-ignore psalm.xml export-ignore +.github export-ignore +.readthedocs.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..3e600c22 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +name: CI + +on: [push, pull_request] + +jobs: + testsuite: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + prefer-lowest: [''] + php-version: ['7.2', '7.4', '8.0'] + include: + - php-version: '7.2' + prefer-lowest: 'prefer-lowest' + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, intl, pdo_${{ matrix.db-type }} + coverage: pcov + + - name: Composer install + run: | + if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then + composer update --prefer-lowest --prefer-stable + else + composer install + fi + + - name: Run PHPUnit + run: | + if [[ ${{ matrix.php-version }} == '7.4' ]]; then + vendor/bin/phpunit --coverage-clover=coverage.xml + else + vendor/bin/phpunit + fi + + - name: Code Coverage Report + if: matrix.php-version == '7.4' + uses: codecov/codecov-action@v1 + + cs-stan: + name: Coding Standard & Static Analysis + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + extensions: mbstring, intl + coverage: none + + - name: Composer Install + run: composer require --dev cakephp/cakephp-codesniffer:^4.1 psalm/phar:^3.18 phpstan/phpstan:^0.12 + + - name: Run phpcs + run: vendor/bin/phpcs --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ + + - name: Run psalm + if: success() || failure() + run: vendor/bin/psalm.phar --output-format=github + + - name: Run phpstan + if: success() || failure() + run: vendor/bin/phpstan.phar analyse --error-format=github diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 27146f70..00000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,21 +0,0 @@ -imports: - - php - -filter: - excluded_paths: - - docs/ - - tests/ -tools: - php_mess_detector: true - php_cpd: - excluded_dirs: - - docs/ - - tests/ - php_loc: - excluded_dirs: - - docs/ - - tests/ - php_pdepend: - excluded_dirs: - 1: docs/ - 2: tests/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fcfdfade..00000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - -env: - global: - - DEFAULT=1 - - LOWEST=0 - -matrix: - fast_finish: true - - include: - - php: 7.2 - env: PHPCS=1 DEFAULT=0 - - - php: 7.2 - env: STATIC_ANALYSIS=1 DEFAULT=0 - - - php: 7.2 - env: DEFAULT=1 LOWEST=1 - -before_script: - - if [[ $TRAVIS_PHP_VERSION != 7.3 ]]; then phpenv config-rm xdebug.ini; fi - - - if [[ $LOWEST = 0 ]]; then composer install --prefer-dist --no-interaction; fi - - if [[ $LOWEST = 1 ]]; then composer update --prefer-lowest --prefer-dist --no-interaction; fi - - - if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:^4.2; fi - - if [[ $STATIC_ANALYSIS = 1 ]]; then composer require phpstan/phpstan:^0.12 psalm/phar:^3.7; fi - -script: - - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.3 ]]; then vendor/bin/phpunit; fi - - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.3 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi - - - if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ config/; fi - - if [[ $STATIC_ANALYSIS = 1 ]]; then vendor/bin/phpstan.phar analyse src && vendor/bin/psalm.phar; fi - -after_success: - - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.3 ]]; then bash <(curl -s https://codecov.io/bash); fi - -notifications: - email: false diff --git a/README.md b/README.md index 9929ffe3..3623ba67 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://img.shields.io/travis/FriendsOfCake/crud-view/master.svg?style=flat-square)](https://travis-ci.org/FriendsOfCake/crud-view) +[![Build Status](https://img.shields.io/github/workflow/status/FriendsOfCake/crud-view/CI/master?style=flat-square)](https://github.com/FriendsOfCake/crud-view/actions?query=workflow%3ACI+branch%3Amaster) [![Total Downloads](https://img.shields.io/packagist/dt/FriendsOfCake/crud-view.svg?style=flat-square)](https://packagist.org/packages/FriendsOfCake/crud-view) [![Latest Stable Version](https://img.shields.io/packagist/v/friendsofcake/crud-view.svg?style=flat-square)](https://packagist.org/packages/FriendsOfCake/crud-view) [![Documentation Status](https://readthedocs.org/projects/crud-view/badge/?version=latest&style=flat-square)](https://readthedocs.org/projects/crud-view/?badge=latest) From 6a4cf72f26899066c3376cbf23d46f07754da0d5 Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 21 Dec 2020 19:07:39 +0530 Subject: [PATCH 2/2] Update phpstan's baseline --- phpstan-baseline.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4886d491..63e135dd 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -61,12 +61,12 @@ parameters: path: src/View/Widget/DateTimeWidget.php - - message: "#^Binary operation \"\\+\" between string and array\\(\\?'data\\-enable\\-seconds' \\=\\> 'true', 'data\\-date\\-format' \\=\\> string, \\?'data\\-enable\\-time' \\=\\> 'true', \\?'data\\-alt\\-format' \\=\\> mixed, \\?'data\\-alt\\-input' \\=\\> 'true', \\?'data\\-no\\-calendar' \\=\\> 'true', \\?'data\\-alt\\-input\\-class' \\=\\> string, 'class' \\=\\> array\\('input\\-group', 'flatpickr'\\)\\) results in an error\\.$#" + message: "#^Binary operation \"\\+\" between string and array\\('data\\-date\\-format' \\=\\> string, \\?'data\\-alt\\-format' \\=\\> mixed, \\?'data\\-alt\\-input' \\=\\> 'true', \\?'data\\-no\\-calendar' \\=\\> 'true', \\?'data\\-enable\\-seconds' \\=\\> 'true', \\?'data\\-enable\\-time' \\=\\> 'true', 'data\\-wrap' \\=\\> mixed, \\?'data\\-alt\\-input\\-class' \\=\\> string, \\.\\.\\.\\) results in an error\\.$#" count: 1 path: src/View/Widget/DateTimeWidget.php - - message: "#^Binary operation \"\\+\\=\" between array\\\\|string and array\\(\\?'data\\-enable\\-seconds' \\=\\> 'true', 'data\\-date\\-format' \\=\\> string, \\?'data\\-enable\\-time' \\=\\> 'true', \\?'data\\-alt\\-format' \\=\\> mixed, \\?'data\\-alt\\-input' \\=\\> 'true', \\?'data\\-no\\-calendar' \\=\\> 'true'\\) results in an error\\.$#" + message: "#^Binary operation \"\\+\\=\" between array\\\\|string and array\\('data\\-date\\-format' \\=\\> string, \\?'data\\-alt\\-format' \\=\\> mixed, \\?'data\\-alt\\-input' \\=\\> 'true', \\?'data\\-no\\-calendar' \\=\\> 'true', \\?'data\\-enable\\-seconds' \\=\\> 'true', \\?'data\\-enable\\-time' \\=\\> 'true', 'data\\-wrap' \\=\\> mixed\\) results in an error\\.$#" count: 1 path: src/View/Widget/DateTimeWidget.php