Skip to content

Merge pull request #40 from valbeat/dependabot/composer/friendsofphp/… #81

Merge pull request #40 from valbeat/dependabot/composer/friendsofphp/…

Merge pull request #40 from valbeat/dependabot/composer/friendsofphp/… #81

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: PHP ${{ matrix.php }} Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php }} with PCOV
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer:v2
ini-values: |
pcov.enabled=1
pcov.directory=.
pcov.exclude=*/vendor/*,*/tests/*
- name: Validate composer.json
run: composer validate --strict
- name: Install dependencies (cached)
uses: ramsey/composer-install@v3
with:
composer-options: --no-interaction --prefer-dist --no-progress
- name: Make report directories
run: mkdir -p build/logs coverage/html
- name: Run PHPUnit with coverage (PCOV)
run: |
vendor/bin/phpunit \
--coverage-clover build/logs/clover.xml \
--coverage-html coverage/html \
--log-junit build/logs/junit.xml \
--colors=always
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: build/logs/clover.xml
flags: unittests
fail_ci_if_error: true
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
files: build/logs/junit.xml
flags: unittests
fail_ci_if_error: true
- name: Upload test artifacts (JUnit & HTML & Clover)
if: always()
uses: actions/upload-artifact@v4
with:
name: php-${{ matrix.php }}-test-artifacts
path: |
build/logs/
coverage/html/
retention-days: 7