Skip to content

Commit

Permalink
Add Codecov to GitHub Actions Workflow (#4)
Browse files Browse the repository at this point in the history
* Add Codecov report upload step in PHP workflow

This commit introduces a new step in the PHP GitHub workflow to upload code coverage reports to Codecov. Using the Codecov action with a specified token and project slug, we can enhance our code quality monitoring with detailed coverage metrics.

* Add separate workflow for Codecov

Moved the Codecov coverage reporting to its own workflow file named codecov.yml. Removed the Codecov reporting steps from the original workflow file php.yml. This separation allows the Codecov action to run independently, providing more flexibility in managing our CI/CD processes.

* Add codecov badge to README

The codecov badge has been introduced to the README.md file. This will aid in visualising code coverage stats and the overall test coverage for the project.
  • Loading branch information
MarjovanLier authored Feb 18, 2024
1 parent 38003a9 commit f05ded2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Workflow for Codecov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up php 8.2
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: mbstring, xml, zip, pdo_mysql, xhprof

- name: Install dependencies
run: composer self-update && composer install && composer dump-autoload

- name: Run tests and collect coverage
run: vendor/bin/phpunit

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: MarjovanLier/StringManipulation
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## 2024-02-18

### Added
- Introduced a new step in the GitHub Actions workflow for PHP to upload code coverage reports to Codecov. This enhancement will allow tracking of code coverage statistics for the project.

## 2024-02-18

### Changed
- Enhanced documentation in the `searchWords` function in `StringManipulation.php` for improved code readability. The added comments explain the function's operations such as null-checking, applying name-fixing standards, replacing special characters and underscores, removing accents, and reducing spaces.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Welcome to the `StringManipulation` library, a robust and efficient PHP toolkit
[![PHPStan Enabled](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://phpstan.org/)
[![Phan Enabled](https://img.shields.io/badge/Phan-enabled-brightgreen.svg?style=flat)](https://github.com/phan/phan/)
[![Psalm Enabled](https://img.shields.io/badge/Psalm-enabled-brightgreen.svg?style=flat)](https://psalm.dev/)
[![codecov](https://codecov.io/github/MarjovanLier/StringManipulation/graph/badge.svg?token=lBTpWlSq37)](https://codecov.io/github/MarjovanLier/StringManipulation)

## Features

Expand Down

0 comments on commit f05ded2

Please sign in to comment.