Skip to content

Commit 70470d6

Browse files
committed
ci: Add codecov coverage report
1 parent a61d192 commit 70470d6

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/code_coverage.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Code Coverage
2+
3+
on:
4+
pull_request: null
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
code_coverage:
11+
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: shivammathur/setup-php@master
16+
with:
17+
php-version: 8.3
18+
coverage: xdebug
19+
- name: Load dependencies from cache
20+
id: composer-cache
21+
run: |
22+
echo "::set-output name=dir::$(composer config cache-files-dir)"
23+
- uses: actions/cache@v4
24+
with:
25+
path: ${{ steps.composer-cache.outputs.dir }}
26+
key: ${{ runner.os }}-php8.3-composer-${{ hashFiles('**/composer.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-php8.3-composer-
29+
30+
- run: composer install --prefer-dist --no-progress --no-suggest
31+
- run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
32+
33+
- uses: codecov/codecov-action@v4
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
36+
files: build/logs/clover.xml # optional
37+
flags: unittests # optional
38+
name: codecov-umbrella # optional
39+
fail_ci_if_error: true # optional (default = false)
40+
verbose: true # optional (default = false)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Type Guard
22

3+
[![codecov](https://codecov.io/gh/pl-github/php-TYPE-GUARD/graph/badge.svg?token=IYNVCXQS8A)](https://codecov.io/gh/pl-github/php-TYPE-GUARD)
4+
35
A PHP library to ensure correctness of types providing a readable interface.
46

57
The library is helpfull to

0 commit comments

Comments
 (0)