Skip to content

Commit ca05ca7

Browse files
authored
Add badges (#34)
Add tests and code coverage badges to readme. You can see how it will look here: https://github.com/8ctopus/byte-buffer
2 parents d46a94d + 55302d5 commit ca05ca7

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,19 @@ jobs:
7878

7979
- name: "Coverage"
8080
run: echo "$(cat ./.phpunit/coverage.txt)"
81+
82+
- name: Make code coverage badge
83+
uses: timkrase/[email protected]
84+
with:
85+
coverage_badge_path: .github/coverage.svg
86+
# push badge later on
87+
push_badge: false
88+
89+
- name: Git push badges to image-data branch
90+
uses: peaceiris/actions-gh-pages@v3
91+
with:
92+
publish_dir: .github
93+
publish_branch: image-data
94+
github_token: ${{ secrets.GITHUB_TOKEN }}
95+
user_name: 'github-actions[bot]'
96+
user_email: 'github-actions[bot]@users.noreply.github.com'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ PHP Wrapper for Google Analytics 4 with Server Side Tracking
33
[![PHP Version](https://img.shields.io/packagist/php-v/alexwestergaard/php-ga4?color=blue&style=for-the-badge)](https://www.php.net/releases/)
44
[![Release Size](https://img.shields.io/github/languages/code-size/alexwestergaard/php-ga4?color=blue&style=for-the-badge)](https://github.com/AlexWestergaard/php-ga4/releases/latest)
55
[![Issues](https://img.shields.io/github/issues-raw/alexwestergaard/php-ga4?color=red&style=for-the-badge)](https://github.com/AlexWestergaard/php-ga4/issues)
6+
[![Tests](https://github.com/AlexWestergaard/php-ga4/actions/workflows/ci.yml/badge.svg)](https://github.com/AlexWestergaard/php-ga4/actions/workflows/ci.yml)
7+
![Code Coverage Badge](https://raw.githubusercontent.com/AlexWestergaard/php-ga4/image-data/coverage.svg)
68

79
```sh
810
composer require alexwestergaard/php-ga4

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<report>
2222
<text outputFile="./.phpunit/coverage.txt" showUncoveredFiles="true"
2323
showOnlySummary="false" />
24+
<clover outputFile="clover.xml"/>
2425
</report>
2526
</coverage>
2627
<php>

0 commit comments

Comments
 (0)