Skip to content

Merge pull request #4 from packagist/fix-workflow #16

Merge pull request #4 from packagist/fix-workflow

Merge pull request #4 from packagist/fix-workflow #16

name: 'Continuous Integration'
on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'
jobs:
syntax-linting:
runs-on: 'ubuntu-22.04'
strategy:
matrix:
php: ['8.1']
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
- run: 'find src/ -type f -name "*.php" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )'
code-style:
runs-on: 'ubuntu-22.04'
strategy:
matrix:
php: ['8.1']
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
coverage: 'none'
php-version: '${{ matrix.php }}'
- name: 'Determine composer cache directory'
id: 'determine-composer-cache-directory'
run: 'echo "::set-output name=directory::$(composer config cache-dir)"'
- name: 'Cache dependencies installed with composer'
uses: 'actions/cache@v3'
with:
path: |
${{ steps.determine-composer-cache-directory.outputs.directory }}
${{ github.workspace }}/vendor
key: "php-${{ matrix.php }}-${{ hashFiles('composer.lock') }}"
restore-keys: 'php-${{ matrix.php }}-'
- uses: 'ramsey/composer-install@v2'
with:
dependency-versions: 'highest'
- run: './vendor/bin/php-cs-fixer fix --dry-run --diff --verbose'
static-analysis:
runs-on: 'ubuntu-22.04'
strategy:
matrix:
php: ['8.1']
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
coverage: 'none'
php-version: '${{ matrix.php }}'
- name: 'Determine composer cache directory'
id: 'determine-composer-cache-directory'
run: 'echo "::set-output name=directory::$(composer config cache-dir)"'
- name: 'Cache dependencies installed with composer'
uses: 'actions/cache@v3'
with:
path: |
${{ steps.determine-composer-cache-directory.outputs.directory }}
${{ github.workspace }}/vendor
key: "php-${{ matrix.php }}-${{ hashFiles('composer.lock') }}"
restore-keys: 'php-${{ matrix.php }}-'
- uses: 'ramsey/composer-install@v2'
with:
dependency-versions: 'highest'
- run: './vendor/bin/phpstan'
phpunit:
runs-on: 'ubuntu-22.04'
strategy:
matrix:
php: ['8.1']
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
coverage: 'none'
php-version: '${{ matrix.php }}'
- name: 'Determine composer cache directory'
id: 'determine-composer-cache-directory'
run: 'echo "::set-output name=directory::$(composer config cache-dir)"'
- name: 'Cache dependencies installed with composer'
uses: 'actions/cache@v3'
with:
path: |
${{ steps.determine-composer-cache-directory.outputs.directory }}
${{ github.workspace }}/vendor
key: "php-${{ matrix.php }}-${{ hashFiles('composer.lock') }}"
restore-keys: 'php-${{ matrix.php }}-'
- uses: 'ramsey/composer-install@v2'
with:
dependency-versions: 'highest'
- run: './vendor/bin/phpunit'