From e1793aa6f4625062fe2637f91205b7bd0092c5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20HULARD?= Date: Wed, 16 Dec 2020 13:02:00 +0100 Subject: [PATCH] chore(ci): Now use GitHub workflows. --- .github/workflows/.editorconfig | 2 + .github/workflows/checks.yml | 30 ++++++++++++ .github/workflows/ci.yml | 84 +++++++++++++++++++++++++++++++++ .github/workflows/static.yml | 36 ++++++++++++++ .scrutinizer.yml | 8 ---- .styleci.yml | 11 ----- .travis.yml | 42 ----------------- README.md | 2 +- composer.json | 2 +- 9 files changed, 154 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/.editorconfig create mode 100644 .github/workflows/checks.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/static.yml delete mode 100644 .scrutinizer.yml delete mode 100644 .styleci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/.editorconfig b/.github/workflows/.editorconfig new file mode 100644 index 0000000..7bd3346 --- /dev/null +++ b/.github/workflows/.editorconfig @@ -0,0 +1,2 @@ +[*.yml] +indent_size = 2 diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..3a3dfee --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,30 @@ +name: Checks + +on: + push: + branches: + - master + pull_request: + +jobs: + composer-normalize: + name: Composer Normalize + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Composer normalize + uses: docker://ergebnis/composer-normalize-action + + roave-bc-check: + name: Roave BC Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Roave BC Check + uses: docker://nyholm/roave-bc-check-ga diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4e8fd12 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,84 @@ +name: CI + +on: + push: + pull_request: + +jobs: + latest: + name: PHP ${{ matrix.php }} Latest + runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.1', '7.2', '7.3', '7.4', '8.0'] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer + coverage: none + + - name: Install dependencies + run: composer update --prefer-dist --no-interaction --no-progress + + - name: boot test server + run: vendor/bin/http_test_server > /dev/null 2>&1 & + + - name: Execute tests + run: composer test + + lowest: + name: PHP ${{ matrix.php }} Lowest + runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.1', '7.2', '7.3', '7.4'] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer + coverage: none + + - name: Install dependencies + run: composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress + + - name: boot test server + run: vendor/bin/http_test_server > /dev/null 2>&1 & + + - name: Execute tests + run: composer test + + coverage: + name: Code Coverage + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + tools: composer + coverage: xdebug + + - name: Install dependencies + run: composer update --prefer-dist --no-interaction --no-progress + + - name: boot test server + run: vendor/bin/http_test_server > /dev/null 2>&1 & + + - name: Execute tests + run: composer test-ci diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..b2f69cf --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,36 @@ +name: Static analysis + +on: + push: + branches: + - master + pull_request: + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: PHPStan + uses: docker://oskarstark/phpstan-ga + env: + REQUIRE_DEV: true + with: + args: analyze --no-progress + + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: PHP-CS-Fixer + uses: docker://oskarstark/php-cs-fixer-ga + with: + args: --dry-run --diff-format udiff diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 46a7560..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,8 +0,0 @@ -filter: - paths: [src/*] -checks: - php: - code_rating: true - duplication: true -tools: - external_code_coverage: true diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index f187ec0..0000000 --- a/.styleci.yml +++ /dev/null @@ -1,11 +0,0 @@ -preset: symfony - -finder: - exclude: - - "spec" - path: - - "src" - - "tests" - -disabled: - - phpdoc_annotation_without_dot # This is still buggy: https://github.com/symfony/symfony/pull/19198 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d732bc3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -sudo: false - -cache: - directories: - - $HOME/.composer/cache/files - -php: - - 7.1 - - 7.2 - - 7.3 - -env: - global: - - TEST_COMMAND="composer test" - -branches: - except: - - /^analysis-.*$/ - -matrix: - fast_finish: true - include: - - php: 7.1 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" - -before_install: - - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini; fi - -install: - - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction - -before_script: - - vendor/bin/http_test_server > /dev/null 2>&1 & - -script: - - $TEST_COMMAND - -after_success: - - if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi - - if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi diff --git a/README.md b/README.md index fb184b7..d964ff6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version](https://img.shields.io/github/release/php-http/react-adapter.svg?style=flat-square)](https://github.com/php-http/react-adapter/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/php-http/react-adapter.svg?style=flat-square)](https://travis-ci.org/php-http/react-adapter) +[![Build Status](https://img.shields.io/github/workflow/status/php-http/react-adapter/CI.svg?style=flat-square)](https://github.com/php-http/react-adapter/actions?query=workflow%3ACI) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/react-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/react-adapter) [![Quality Score](https://img.shields.io/scrutinizer/g/php-http/react-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/react-adapter) [![Total Downloads](https://img.shields.io/packagist/dt/php-http/react-adapter.svg?style=flat-square)](https://packagist.org/packages/php-http/react-adapter) diff --git a/composer.json b/composer.json index 50614e7..4f3005f 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.1", + "php": "^7.1|^8.0", "php-http/httplug": "^2.0", "react/http": "^1.0", "react/event-loop": "^1.0",