chore(coverage): implement coverage report with docker #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'coverage-report' | |
on: | |
push: | |
branches: | |
- main | |
- chore/code-coverage # remove before merge to main | |
permissions: | |
contents: write | |
jobs: | |
coverage-report: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
coverage: none | |
tools: composer:v2 | |
extensions: xdebug | |
- name: Install Dependencies | |
run: composer install -q --profile --ignore-platform-reqs --no-interaction --no-ansi --no-scripts --no-suggest --prefer-dist | |
- name: PHPUnit | |
run: docker-compose run phpunit --coverage-xml cov/xml --coverage-html cov/html --coverage-clover=cov/xml/clover.xml | |
- name: "Parse Coverage" | |
run: "php ./coverage.php" | |
- name: Create Coverage Badges | |
uses: jaywcjlove/coverage-badges-cli@e07f25709cd25486855c1ba1b26da53576ff3620 | |
with: | |
source: cov/json/index.json | |
output: cov/html/coverage.svg | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@8817a56e5bfec6e2b08345c81f4d422db53a2cdc | |
with: | |
branch: gh-pages | |
folder: cov/html |