diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f2f8aa5..e4514c1 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,6 +1,11 @@ name: Test -on: [push] +on: + push: + branches: ["master"] + merge_group: + pull_request: + branches: ["master"] jobs: test: @@ -9,35 +14,41 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.0', '8.1'] + php-versions: ['8.0', '8.1', '8.2'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents. # If you use a shallow git checkout, please checkout at least a depth of one."), # see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository fetch-depth: 10 + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: curl, mbstring, intl, libxml, simplexml coverage: xdebug + - name: Get composer cache directory id: composer-cache-dir - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: Cache Composer packages id: composer-cache-restore - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache-dir.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies run: (test -d vendor && echo vendor directory exists) || composer install --prefer-dist --no-progress --no-suggest + - name: Run PHPUnit run: ./bin/phpunit --coverage-text --coverage-clover clover.xml + - name: Upload Scrutinizer coverage if: matrix.php-versions == '8.0' uses: sudo-bot/action-scrutinizer@latest diff --git a/README.md b/README.md index 746a759..0bce2fc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Patch Manager [![PHP Version](https://img.shields.io/packagist/php-v/cypresslab/patch-manager/dev-master)](https://packagist.org/packages/cypresslab/patch-manager) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/matteosister/patch-manager/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/matteosister/patch-manager/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/matteosister/patch-manager/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/matteosister/patch-manager/?branch=master) -[![Build Status](https://img.shields.io/github/workflow/status/matteosister/patch-manager/Test)](https://github.com/matteosister/patch-manager/actions) +[![Build Status](https://img.shields.io/github/actions/workflow/status/matteosister/patch-manager/php.yml?branch=master](https://github.com/matteosister/patch-manager/actions) [![Packagist Version](https://img.shields.io/packagist/v/cypresslab/patch-manager)](https://packagist.org/packages/cypresslab/patch-manager) [![Packagist Downloads](https://img.shields.io/packagist/dt/cypresslab/patch-manager)](https://packagist.org/packages/cypresslab/patch-manager) @@ -17,12 +17,8 @@ A php library to manage PATCH requests in a standardized (and elegant) way Install with composer -``` json -{ - "require": { - "cypresslab/patch-manager": "^2.0" - } -} +```shell +composer require cypresslab/patch-manager ``` The idea for this library comes from this blog post: [Please. Don't Patch Like An Idiot.](http://williamdurand.fr/2014/02/14/please-do-not-patch-like-an-idiot/) by [William Durand](https://github.com/willdurand)