2020-07-23 14:21:26 +02:00
|
|
|
name: build
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
run:
|
2020-07-23 16:56:51 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-07-23 14:21:26 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-07-23 17:31:54 +02:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
2020-07-23 16:56:51 +02:00
|
|
|
php-versions: ["7.1", "7.2", "7.3", "7.4"]
|
|
|
|
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.os }}
|
2020-07-23 14:21:26 +02:00
|
|
|
steps:
|
2020-07-23 16:56:51 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-07-23 14:21:26 +02:00
|
|
|
|
2020-07-23 16:56:51 +02:00
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-versions }}
|
2020-07-23 17:03:53 +02:00
|
|
|
extensions: mbstring, intl, sockets
|
2020-07-23 17:21:32 +02:00
|
|
|
coverage: xdebug
|
2020-07-23 14:21:26 +02:00
|
|
|
|
2020-07-23 16:56:51 +02:00
|
|
|
- name: Check environment
|
|
|
|
run: |
|
|
|
|
php --version
|
|
|
|
composer --version
|
2020-07-23 14:21:26 +02:00
|
|
|
|
2020-07-23 16:56:51 +02:00
|
|
|
- name: Get composer cache directory
|
|
|
|
id: composercache
|
|
|
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
2020-07-23 14:21:26 +02:00
|
|
|
|
2020-07-23 16:56:51 +02:00
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ${{ steps.composercache.outputs.dir }}
|
2020-07-23 17:33:43 +02:00
|
|
|
key: ${{ matrix.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: ${{ matrix.os }}-composer-${{ matrix.php-versions }}-
|
2020-07-23 14:21:26 +02:00
|
|
|
|
2020-07-23 16:56:51 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install --prefer-dist
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
env:
|
|
|
|
PHP_CS_FIXER_IGNORE_ENV: 1
|
|
|
|
run: |
|
2020-07-23 17:21:32 +02:00
|
|
|
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
|
2020-07-23 16:56:51 +02:00
|
|
|
vendor/bin/php-cs-fixer --diff --dry-run -v fix
|
|
|
|
vendor/bin/psalm
|