Skip to content

Merge pull request #199 from MaxGoryunov/196 #528

Merge pull request #199 from MaxGoryunov/196

Merge pull request #199 from MaxGoryunov/196 #528

Workflow file for this run

name: PHP Composer CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP with Composer, Xdebug & tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: xdebug
tools: composer
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHPUnit tests with coverage
run: vendor/bin/phpunit --configuration=phpunit.xml --coverage-text
- name: Infection analysis
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
run: |
XDEBUG_MODE=coverage ./vendor/bin/infection \
--min-msi=90 --min-covered-msi=90 --threads=4 \
--configuration=./infection.json.dist
- name: Create PHPUnit coverage report
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: tests
name: codecov-umbrella
fail_ci_if_error: true
- name: Check minimum coverage
run: ./vendor/bin/coverage-check coverage.xml 100 --only-percentage
- name: PHPStan analysis
run: ./vendor/bin/phpstan analyse