Skip to content

Fix #46

Fix #46 #22

name: 'CI'
on:
pull_request:
push:
branches:
- 'main'
env:
COMPOSER_ROOT_VERSION: '1.99.99'
jobs:
lint:
name: 'Lint'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
php-version: '7.4'
coverage: 'none'
ini-values: 'memory_limit=-1'
tools: 'composer:v2'
- uses: 'ramsey/composer-install@v1'
- name: 'Lint the PHP source code'
run: './vendor/bin/parallel-lint src test'
coding-standards:
name: 'Coding Standards'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
php-version: '7.4'
coverage: 'none'
ini-values: 'memory_limit=-1'
tools: 'composer:v2'
- uses: 'ramsey/composer-install@v1'
- name: 'Check coding standards'
run: './vendor/bin/phpcs src --standard=psr2 -sp --colors'
unit-tests:
name: 'Unit Tests'
runs-on: 'ubuntu-latest'
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php-version:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
dependencies:
- 'lowest'
- 'highest'
experimental:
- false
include:
- php-version: '8.1'
experimental: true
composer-options: '--ignore-platform-reqs'
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'pcov'
ini-values: 'memory_limit=-1'
tools: 'composer:v2'
- name: 'Prepare for tests'
run: 'mkdir -p build/logs'
- uses: 'ramsey/composer-install@v1'
with:
dependency-versions: '${{ matrix.dependencies }}'
composer-options: '${{ matrix.composer-options }}'
- name: 'Run unit tests'
run: './vendor/bin/phpunit --colors=always --coverage-clover build/logs/clover.xml'
- name: 'Publish coverage report to Codecov'
uses: 'codecov/codecov-action@v1'