Skip to content

Commit

Permalink
update github actions workflow (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiabasone authored Mar 22, 2023
1 parent 771d867 commit 87bf840
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Test

on: [push]
on:
push:
branches: ["master"]
merge_group:
pull_request:
branches: ["master"]

jobs:
test:
Expand All @@ -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
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit 87bf840

Please sign in to comment.