Skip to content

Code coverage: add support to e2e tests #568

Code coverage: add support to e2e tests

Code coverage: add support to e2e tests #568

Workflow file for this run

name: PHPUnit Tests
on:
push:
branches:
- trunk
- 'branch/*'
pull_request:
branches:
- trunk
- 'branch/*'
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Minimum supported PHP
- php: '7.4'
# Latest stable PHP
- php: '8.4'
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: composer:v2
- name: Install dependencies
run: |
composer install --no-progress --prefer-dist --no-interaction
- name: Run PHPUnit with coverage
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: WordPress/secure-custom-fields
files: ./coverage.xml