Merge pull request #152 from Sysix/fix-file-voucher-upload #18
This file contains 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: [ development ] | |
pull_request: | |
branches: [ development ] | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
coverage: xdebug | |
- name: Install dependencies | |
run: | | |
composer install --prefer-dist | |
- name: Execute tests with coverage | |
run: vendor/bin/phpunit --configuration 'phpunit.xml' --coverage-clover=coverage.xml | |
- if: ${{ github.event_name == 'pull_request' }} | |
name: Download artifact | |
uses: dawidd6/action-download-artifact@v3 | |
continue-on-error: true | |
with: | |
workflow: .github/workflows/coverage-report.yml | |
branch: development | |
name: coverage-report | |
path: tests/base | |
- if: ${{ github.event_name != 'pull_request' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage-report | |
path: coverage.xml | |
- if: ${{ github.event_name == 'pull_request' }} | |
name: Coverage Report as Comment (Clover) | |
uses: lucassabreu/comment-coverage-clover@main | |
with: | |
file: coverage.xml | |
base-file: test/base/coverage.xml | |
- if: ${{ github.event_name != 'pull_request' }} | |
uses: action-badges/[email protected] | |
with: | |
branch-name: badges | |
- if: ${{ github.event_name != 'pull_request' }} | |
name: Make Coverage Badge | |
uses: action-badges/[email protected] | |
with: | |
file-name: coverage.svg | |
badge-branch: badges | |
github-token: '${{ secrets.GITHUB_TOKEN }}' | |
coverage-file-name: ./coverage.xml |