Skip to content

Commit fe8587d

Browse files
committed
Send code coverage to Scrutinizer CI
1 parent 86690c5 commit fe8587d

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ jobs:
6464
- run: vendor/bin/phpunit --no-coverage
6565
if: ${{ !matrix.coverage }}
6666

67-
- run: vendor/bin/phpunit --coverage-text
67+
- run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
6868
if: ${{ matrix.coverage }}
6969

70+
- run: php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
71+
if: ${{ matrix.coverage }}
72+
continue-on-error: true
73+
7074
phpstan:
7175
name: PHPStan
7276
runs-on: ubuntu-latest

.scrutinizer.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
build:
4+
nodes:
5+
analysis:
6+
tests:
7+
override:
8+
- php-scrutinizer-run
9+
checks:
10+
php:
11+
code_rating: true
12+
remove_extra_empty_lines: true
13+
remove_php_closing_tag: true
14+
remove_trailing_whitespace: true
15+
fix_use_statements:
16+
remove_unused: true
17+
preserve_multiple: false
18+
preserve_blanklines: true
19+
order_alphabetically: true
20+
fix_php_opening_tag: true
21+
fix_linefeed: true
22+
fix_line_ending: true
23+
fix_identation_4spaces: true
24+
fix_doc_comments: true
25+
excluded_dependencies:
26+
- commonmark/commonmark.js
27+
tools:
28+
external_code_coverage:
29+
timeout: 1800
30+
runs: 2
31+
php_analyzer: true
32+
php_code_coverage: false
33+
php_code_sniffer:
34+
config:
35+
standard: PSR2
36+
filter:
37+
paths: ['src']
38+
php_cpd:
39+
enabled: true
40+
excluded_dirs: [vendor, tests]
41+
php_loc:
42+
enabled: true
43+
excluded_dirs: [vendor, tests]
44+
php_pdepend: true
45+
php_sim: true
46+

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"require-dev": {
2929
"phpstan/phpstan": "^1.9.2",
3030
"phpunit/phpunit": "^9.5.5",
31+
"scrutinizer/ocular": "^1.8.1",
3132
"unleashedtech/php-coding-standard": "^3.1",
3233
"vimeo/psalm": "^4.30.0"
3334
},

0 commit comments

Comments
 (0)