Skip to content
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
11caf1f
Fix Codecov badge by adding OIDC permission for tokenless upload
nimesh-xecurify Mar 28, 2026
1497fe7
Enables OIDC for Codecov action
nimesh-xecurify Mar 28, 2026
fa58b7e
Prepares workflow for code coverage
nimesh-xecurify Mar 28, 2026
5e6556a
Enables Codecov report upload
nimesh-xecurify Mar 28, 2026
91881c2
Removes redundant coverage report retrieval
nimesh-xecurify Mar 28, 2026
ba3d8a2
Fix coverage file retrieval via docker exec on persistent container
nimesh-xecurify Mar 28, 2026
07a7398
Add debug step to diagnose coverage report content and xdebug mode
nimesh-xecurify Mar 28, 2026
e6bcc88
Ensure robust code coverage report retrieval and upload
nimesh-xecurify Mar 28, 2026
2513a33
Streamlines CI coverage report handling
nimesh-xecurify Mar 28, 2026
3d9317b
Fetches coverage report from test container
nimesh-xecurify Mar 28, 2026
367f804
Ensures robust code coverage generation in CI
nimesh-xecurify Mar 28, 2026
68452bd
Adjusts `wp-env` coverage command
nimesh-xecurify Mar 28, 2026
e8a9180
Streamlines CI coverage generation
nimesh-xecurify Mar 28, 2026
683a838
Merge branch 'master' into codecov-integration
masteradhoc Mar 28, 2026
83f5ee5
Removes redundant coverage report retrieval
nimesh-xecurify Mar 29, 2026
10a1cbb
Merge branch 'master' into codecov-integration
nimesh-xecurify May 14, 2026
3783602
Scope Codecov OIDC permission to a dedicated upload job
nimesh-xecurify Jul 3, 2026
9563db7
Merge branch 'master' into codecov-integration
nimesh-xecurify Jul 3, 2026
2cf6841
Merge branch 'master' into codecov-integration
masteradhoc Aug 1, 2026
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
50 changes: 46 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,63 @@ jobs:
- name: Composer install
run: |
rm composer.lock || true # We need to install fresh.
npm run composer install
# The composer.json platform override (php: 7.2.24) installs PHPUnit 8.5, which
# cannot generate code coverage on PHP 8. For the coverage build only, bypass the
# platform check so Composer installs PHPUnit 9.6. All other matrix jobs keep the
# default dependency set.
if [[ "${{ matrix.php }}" == "8.3" && "${{ matrix.wp }}" == "latest" ]]; then
npm run composer -- install --ignore-platform-req=php
else
npm run composer install
fi

- name: Versions
run: |
npm run env run cli php -- -v
npm run env run cli wp core version

- name: Test
run: npm run test
run: |
npm run env run tests-cli --env-cwd=wp-content/plugins/two-factor -- mkdir -p tests/logs
npm run test

- name: Upload code coverage report
- name: Upload coverage report artifact
if: ${{ matrix.php == '8.3' && matrix.wp == 'latest' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-report
path: tests/logs/clover.xml
if-no-files-found: error # Coverage silently going missing is the bug this is meant to fix.

# Uploading to Codecov without a CODECOV_TOKEN requires OIDC (`id-token: write`).
# That permission is kept out of the test jobs, which run npm/Composer dependencies
# and the test suite; this job only runs the pinned actions below. The Codecov badge
# reflects the default branch, so uploading on pushes is sufficient and no PR-triggered
# run ever holds the permission.
coverage:
name: Upload code coverage
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: test-php
if: ${{ github.event_name == 'push' }}
permissions:
contents: read # Required to clone the repo, which Codecov uses to attribute the report.
id-token: write # Required for tokenless (OIDC) upload to Codecov.
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Download coverage report artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage-report
path: tests/logs

- name: Upload code coverage report
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
file: tests/logs/clover.xml
use_oidc: true
files: tests/logs/clover.xml
flags: phpunit
fail_ci_if_error: false

Expand Down