Merge pull request #207 from paragonie/coverage-badge #14
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 | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| coverage: | |
| name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }} | |
| runs-on: ${{ matrix.operating-system }} | |
| if: "!contains(github.event.head_commit.message, '[ci]')" | |
| strategy: | |
| matrix: | |
| operating-system: ['ubuntu-latest'] | |
| php-versions: ['8.4'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: mbstring, intl, sodium, xdebug | |
| ini-values: error_reporting=-1, display_errors=On | |
| coverage: xdebug | |
| - name: Install Composer dependencies | |
| uses: "ramsey/composer-install@v3" | |
| - name: Ensure XML file is being loaded | |
| run: cp phpunit.xml.dist phpunit.xml | |
| - name: PHPUnit tests with coverage | |
| run: vendor/bin/phpunit --coverage-clover clover.xml --coverage-html build/coverage-report | |
| - name: phpunit-coverage-badge | |
| uses: timkrase/phpunit-coverage-badge@v1.2.1 | |
| with: | |
| coverage_badge_path: .github/coverage.svg | |
| push_badge: false | |
| - name: Git push to image-data branch | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| publish_dir: .github | |
| publish_branch: image-data | |
| github_token: ${{ secrets.TOKEN }} | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' |