-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (31 loc) · 1005 Bytes
/
test-coverage-badge.yml
File metadata and controls
40 lines (31 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: test-coverage-badge
on: workflow_dispatch
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.0]
stability: [prefer-stable]
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest --coverage-clover clover.xml
- name: Generate test coverage badge
uses: timkrase/phpunit-coverage-badge@v1.2.0
with:
coverage_badge_path: "badge-coverage.svg"
push_badge: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
- name: remove clover.xml
run: rm clover.xml