Update coverage badge generation #35
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: Run Pest Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
pest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
tools: composer:v2 | |
coverage: xdebug | |
env: | |
XDEBUG_MODE: coverage | |
# Install (and cache) Composer dependencies | |
- uses: ramsey/composer-install@v3 | |
- name: Run Pest tests | |
run: composer pest:test -- --ci --coverage-clover=.github/clover.xml | |
- name: Generate code coverage badge | |
uses: timkrase/[email protected] | |
if: github.ref == 'refs/heads/main' | |
with: | |
report: '.github/clover.xml' | |
coverage_badge_path: '.github/badge-coverage.svg' | |
push_badge: true | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
commit_message: 'chore: update coverage badge [skip ci]' |