Skip to content

Commit 223c727

Browse files
committed
Add GitHub workflow 'coverage'
Creates a code coverage badge in .github/coverage.svg using PHPUnit on every push.
1 parent c3b9549 commit 223c727

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '7.2'
19+
coverage: xdebug
20+
21+
- name: Install dependencies
22+
run: composer update --prefer-dist --no-progress
23+
24+
- name: Run PHPUnit test suite
25+
run: ./vendor/bin/phpunit --configuration ./tests/phpunit.xml
26+
27+
- name: Update code coverage badge
28+
uses: timkrase/[email protected]
29+
with:
30+
report: ./tests/clover.xml
31+
report_type: clover
32+
coverage_badge_path: ./.github/coverage.svg
33+
push_badge: true
34+
repo_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)