Skip to content

test on latests php versions #15

test on latests php versions

test on latests php versions #15

name: Continuous Integration
on: [push, pull_request]
jobs:
build:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ 'ubuntu-latest' ]
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate --strict --no-check-publish --ansi
- 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: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff --ansi
- name: Run PHPStan
run: vendor/bin/phpstan analyze --memory-limit=-1 --ansi
- name: Run PHPUnit
run: vendor/bin/phpunit --colors=always --coverage-clover=coverage.xml
- name: Run PHP MD
run: vendor/bin/phpmd src text ruleset.xml --suffixes php
- name: Upload Code Coverage to Codecov.io
uses: codecov/codecov-action@v1