generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (48 loc) · 1.42 KB
/
coverage.yml
File metadata and controls
51 lines (48 loc) · 1.42 KB
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
41
42
43
44
45
46
47
48
49
50
51
name: coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
pest-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.2, 8.3]
name: Coverage PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v4
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: |
~/.composer/cache
vendor
key: coverage-${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
coverage-${{ runner.os }}-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: phpunit
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run Pest with coverage
run: vendor/bin/pest --coverage --coverage-clover=build/logs/clover.xml
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.php }}
path: build/logs/clover.xml
- name: Optional Codecov upload
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v4
with:
token: ${{ env.CODECOV_TOKEN }}
files: build/logs/clover.xml
fail_ci_if_error: true