2020-11-25 10:33:50 +03:00
|
|
|
name: PHP Composer
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ 'master', '2.x' ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ 'master', '2.x' ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-01-30 09:39:30 +03:00
|
|
|
# https://github.com/marketplace/actions/setup-php-action#github-hosted-runners
|
2020-11-25 10:33:50 +03:00
|
|
|
operating-system: [ 'ubuntu-latest' ]
|
2021-01-30 09:39:30 +03:00
|
|
|
php-versions: [ '7.3', '7.4', '8.0' ]
|
2020-11-25 10:33:50 +03:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Validate composer.json and composer.lock
|
|
|
|
run: composer validate
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-versions }}
|
|
|
|
tools: phpunit, phpstan
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install --prefer-dist --no-progress --no-suggest
|
|
|
|
|
|
|
|
- name: PHP Unit Tests
|
|
|
|
run: composer test
|
|
|
|
|
|
|
|
- name: PHP Stan
|
2021-01-30 09:39:30 +03:00
|
|
|
if: matrix.php-versions == '7.3'
|
2020-11-25 10:33:50 +03:00
|
|
|
run: |
|
|
|
|
phpstan --version
|
|
|
|
phpstan analyse
|
|
|
|
|
|
|
|
- name: Scrunitizer CI
|
2021-01-30 09:39:30 +03:00
|
|
|
if: matrix.php-versions == '7.3'
|
2020-11-25 10:33:50 +03:00
|
|
|
run: |
|
|
|
|
wget https://scrutinizer-ci.com/ocular.phar
|
|
|
|
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
|