Skip to content

Commit cdd1c0b

Browse files
authored
Merge pull request #20 from Jurj-Bogdan/3.0
Codecov config
2 parents b38f721 + 5ccf65a commit cdd1c0b

1 file changed

Lines changed: 50 additions & 4 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,53 @@
11
on:
22
- push
33

4-
name: Codecov checks
5-
uses: codecov/codecov-action@v3
6-
env:
7-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4+
name: Run Codecov checks
5+
6+
jobs:
7+
code-coverage:
8+
name: Code Coverage
9+
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
17+
php:
18+
- "8.1"
19+
- "8.2"
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: "${{ matrix.php }}"
29+
coverage: pcov
30+
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
31+
tools: composer:v2, cs2pr
32+
33+
- name: Determine composer cache directory
34+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
35+
36+
- name: Cache dependencies installed with composer
37+
uses: actions/cache@v3
38+
with:
39+
path: ${{ env.COMPOSER_CACHE_DIR }}
40+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: |
42+
php${{ matrix.php }}-composer-
43+
44+
- name: Install dependencies with composer
45+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
46+
47+
- name: Collect code coverage with PHPUnit
48+
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml
49+
50+
- name: Send code coverage report to Codecov.io
51+
uses: codecov/codecov-action@v3
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)