-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.54 KB
/
coverage-report.yaml
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
52
53
54
55
56
57
58
59
60
61
name: Code Coverage
on:
pull_request:
push:
paths:
- '!.github/**'
- '.github/workflows/coverage-report.yaml'
branches:
- main
jobs:
php-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
name: Code Coverage Report
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: pcov
ini-values: zend.assertions=1
tools: composer:v2,flex
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Execute Unit Tests
run: composer test:coverage
- if: ${{ github.event_name == 'pull_request' }}
name: Download artifact
uses: dawidd6/action-download-artifact@v6
continue-on-error: true
with:
workflow: .github/workflows/coverage-report.yaml # this file
branch: main
name: coverage-report
path: coverage/base
- if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/clover.xml
- name: Coverage Report as Comment (Clover)
if: ${{ github.event_name == 'pull_request' }}
uses: lucassabreu/comment-coverage-clover@main
with:
file: coverage/clover.xml
base-file: coverage/base/clover.xml
with-chart: false
with-branches: false