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
24 changes: 19 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]
php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]
services:
mysql:
image: mariadb:11.4
Expand Down Expand Up @@ -43,6 +43,11 @@ jobs:
run: |
install-php-extensions mysqli gd bcmath || echo "Extensions may already be installed."

- name: Install Xdebug for Coverage
if: matrix.php-version == '8.3'
run: |
install-php-extensions xdebug || echo "Xdebug may already be installed."

- name: Self-update Composer
run: |
composer self-update || echo "Composer update skipped due to permission issue."
Expand All @@ -67,15 +72,24 @@ jobs:
rm -rf /tmp/wordpress-tests-lib /tmp/wordpress/
bash bin/install-wp-tests.sh wordpress_test root root mysql latest

- name: Run PHPUnit Tests
if: matrix.php-version != '8.3'
run: vendor/bin/phpunit

- name: Run PHPUnit Tests with Coverage
run: vendor/bin/phpunit --coverage-clover=coverage.xml
if: matrix.php-version == '8.3'
run: |
php -d zend_extension=xdebug.so -d xdebug.mode=coverage \
vendor/bin/phpunit --coverage-clover=coverage.xml --coverage-text \
| tee coverage-summary.txt

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
- name: Upload coverage to Codecov
if: matrix.php-version == '8.3'
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
name: php-${{ matrix.php-version }}
fail_ci_if_error: false
Comment on lines +88 to 93
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix: file input renamed to files in codecov-action@v5.

The static analysis correctly identified that codecov/codecov-action@v5 renamed the file input to files.

🐛 Proposed fix
       - name: Upload coverage to Codecov
         if: matrix.php-version == '8.3'
         uses: codecov/codecov-action@v5
         with:
-          file: ./coverage.xml
+          files: ./coverage.xml
           flags: unittests
           name: php-${{ matrix.php-version }}
           fail_ci_if_error: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
name: php-${{ matrix.php-version }}
fail_ci_if_error: false
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
name: php-${{ matrix.php-version }}
fail_ci_if_error: false
🧰 Tools
🪛 actionlint (1.7.10)

[error] 90-90: input "file" is not defined in action "codecov/codecov-action@v5". available inputs are "base_sha", "binary", "codecov_yml_path", "commit_parent", "directory", "disable_file_fixes", "disable_safe_directory", "disable_search", "disable_telem", "dry_run", "env_vars", "exclude", "fail_ci_if_error", "files", "flags", "force", "gcov_args", "gcov_executable", "gcov_ignore", "gcov_include", "git_service", "handle_no_reports_found", "job_code", "name", "network_filter", "network_prefix", "os", "override_branch", "override_build", "override_build_url", "override_commit", "override_pr", "plugins", "recurse_submodules", "report_code", "report_type", "root_dir", "run_command", "skip_validation", "slug", "swift_project", "token", "url", "use_legacy_upload_endpoint", "use_oidc", "use_pypi", "verbose", "version", "working-directory"

(action)

🤖 Prompt for AI Agents
In @.github/workflows/tests.yml around lines 88 - 93, The workflow uses
codecov/codecov-action@v5 with the deprecated input name "file"; update the
action input from "file: ./coverage.xml" to the new "files: ./coverage.xml"
(preserving the same path) so the Codecov action recognizes the coverage
artifact; locate the codecov/codecov-action@v5 block in the YAML and replace the
"file" key with "files" (leave other keys like flags, name, and fail_ci_if_error
unchanged).

env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Loading
Loading