Skip to content

Commit

Permalink
Coverage badge experiment in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
alimranahmed committed Jun 22, 2024
1 parent 1795dae commit e1d3a0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,12 @@ jobs:
DB_USERNAME: root
DB_PASSWORD: password
run: |
vendor/bin/phpunit --coverage-clover tests/coverage/clover.xml
vendor/bin/phpunit --coverage-clover clover.xml
vendor/bin/pint
- name: Generate coverage badge
uses: tj-actions/coverage-badge-go@v1
- name: Generate test coverage badge
uses: timkrase/phpunit-coverage-badge@v1.2.0
with:
file: tests/coverage/clover.xml
output: tests/coverage/badge.svg

- name: Upload coverage badge
uses: actions/upload-artifact@v2
with:
name: coverage-badge
path: tests/coverage/badge.svg

- name: Commit coverage badge
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update coverage badge
file_pattern: coverage-badge.svg
coverage_badge_path: 'tests/coverage/badge-coverage.svg'
push_badge: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Test Coverage](https://raw.githubusercontent.com/alimranahmed/LaraBlog/main/tests/coverage/badge-coverage.svg)](https://packagist.org/packages/hi-folks/array)
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)


Expand Down

0 comments on commit e1d3a0b

Please sign in to comment.