Merge pull request #152 from mlahargou/php-8-4-fixes #197
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Test | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 3 | |
matrix: | |
php: | |
- '7.3' | |
- '7.4' | |
- '8.0' | |
- '8.1' | |
analysis: [ false ] | |
coverage: [ 'none' ] | |
fast-fail: [ false ] | |
normalize: [ false ] | |
validate: [ false ] | |
exclude: | |
- php: '8.0' | |
- php: '8.1' | |
include: | |
- php: '8.0' | |
analysis: true | |
coverage: 'xdebug' | |
normalize: true | |
validate: true | |
- php: '8.1' | |
fast-fail: true | |
name: PHP ${{ matrix.php }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php: ${{ matrix.php }} | |
coverage: ${{ matrix.coverage }} | |
extensions: json, mbstring | |
env: | |
fail-fast: ${{ matrix.fast-fail }} | |
- name: Validate composer setup | |
if: matrix.validate == true | |
run: composer validate --strict | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: "php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}" | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Normalize composer file | |
if: matrix.normalize == true | |
run: composer normalize --dry-run | |
- name: Run test suite | |
run: vendor/bin/phpunit -v | |
- name: Run static code analysis | |
if: matrix.analysis == true | |
run: vendor/bin/phpstan --memory-limit=-1 | |
- name: Upload coverage results | |
uses: codecov/codecov-action@v1 | |
if: matrix.coverage != 'none' |