Skip to content

Commit f8685aa

Browse files
authored
Enable codecov (#758)
1 parent a93a712 commit f8685aa

File tree

8 files changed

+42
-22
lines changed

8 files changed

+42
-22
lines changed

.github/workflows/ci.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ jobs:
7070

7171
steps:
7272
- name: Checkout code
73-
uses: actions/checkout@v2
73+
uses: actions/checkout@v3
7474

7575
- name: Setup PHP
7676
uses: shivammathur/setup-php@v2
7777
with:
7878
php-version: ${{ matrix.php }}
79-
coverage: none
79+
coverage: pcov
8080
tools: composer:v2
8181

8282
- name: Install Composer dependencies
@@ -97,3 +97,6 @@ jobs:
9797
9898
- name: Run phpunit
9999
run: composer test:ci
100+
101+
- name: Upload code coverage
102+
uses: codecov/codecov-action@v3

.github/workflows/cs.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
2121
php-version: '8.2'
22+
coverage: none
2223

2324
- name: Install dependencies
2425
run: composer update --no-progress --no-interaction --prefer-dist

.github/workflows/publish-release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
name: Release version
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
token: ${{ secrets.GH_RELEASE_PAT }}
2121
fetch-depth: 0

.github/workflows/static-analysis.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
uses: shivammathur/setup-php@v2
2020
with:
2121
php-version: '8.2'
22+
coverage: none
2223

2324
- name: Install dependencies
2425
run: composer update --no-progress --no-interaction --prefer-dist

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
composer.lock
77

88
# phpunit/phpunit
9+
coverage.xml
910
.phpunit.result.cache
1011

1112
# friendsofphp/php-cs-fixer

codecov.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
comment: false
2+
3+
coverage:
4+
status:
5+
project:
6+
default:
7+
threshold: 0.1% # allow for 0.1% reduction of coverage without failing

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"scripts": {
5050
"test": "vendor/bin/phpunit",
5151
"tests": "@test",
52-
"test:ci": "vendor/bin/phpunit",
52+
"test:ci": "vendor/bin/phpunit --coverage-clover=coverage.xml",
5353
"phpcs": "vendor/bin/php-cs-fixer fix",
5454
"phpcs:ci": "vendor/bin/php-cs-fixer fix --dry-run --diff",
5555
"phpstan": "vendor/bin/phpstan analyse",

phpunit.xml

+24-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
backupGlobals="true"
35
colors="true"
4-
convertErrorsToExceptions="true"
5-
convertNoticesToExceptions="true"
6-
convertWarningsToExceptions="true"
7-
processIsolation="false"
8-
stopOnFailure="false"
9-
bootstrap="test/bootstrap.php">
10-
<testsuites>
11-
<testsuite name="Sentry Test Suite">
12-
<directory>./test/Sentry/</directory>
13-
</testsuite>
14-
</testsuites>
15-
<coverage>
16-
<include>
17-
<directory suffix=".php">./src/Sentry/</directory>
18-
</include>
19-
</coverage>
6+
bootstrap="test/bootstrap.php"
7+
cacheResult="false"
8+
beStrictAboutOutputDuringTests="true"
9+
>
10+
<testsuites>
11+
<testsuite name="Sentry Laravel Test Suite">
12+
<directory>./test/Sentry/</directory>
13+
</testsuite>
14+
</testsuites>
15+
16+
<coverage>
17+
<include>
18+
<directory suffix=".php">./src/Sentry/</directory>
19+
</include>
20+
</coverage>
21+
22+
<filter>
23+
<whitelist>
24+
<directory suffix=".php">src</directory>
25+
</whitelist>
26+
</filter>
2027
</phpunit>

0 commit comments

Comments
 (0)