Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 47 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,61 @@ on:

jobs:
test:
name: PHP ${{ matrix.php }} Tests
runs-on: ubuntu-latest
name: PHP 8.4 Tests

strategy:
fail-fast: false
matrix:
php: ['8.4']

steps:
- uses: actions/checkout@v4

- name: Setup PHP 8.4
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP ${{ matrix.php }} with PCOV
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: xdebug
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: Cache Composer packages
uses: actions/cache@v3

- name: Install dependencies (cached)
uses: ramsey/composer-install@v3
with:
path: vendor
key: ${{ runner.os }}-php-8.4-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.4-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test

- name: Generate coverage report
run: ./vendor/bin/phpunit --coverage-clover coverage.xml

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@v3
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
files: build/logs/clover.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
fail_ci_if_error: true
verbose: 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.phpunit.cache/
/.phpunit.result.cache
/coverage/
/build/
.DS_Store
/.php-cs-fixer.cache