Skip to content

fix coverage

fix coverage #20

Workflow file for this run

name: PHP CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
quality-and-test:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true # upgrade 24 (it was weird!)
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug # Enable Xdebug for coverage
- name: Get Composer cache dir
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache Composer
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-php-${{ matrix.php }}-
composer-${{ runner.os }}-
- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
- name: PHP CS
run: vendor/bin/phpcs
- name: PHPStan
run: vendor/bin/phpstan analyse
- name: PHPUnit with Coverage
run: vendor/bin/phpunit --coverage-clover=./.tmp/phpunit/coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ArrayIterator/credit-card
files: ./.tmp/phpunit/coverage.xml
fail_ci_if_error: false
verbose: true