File tree Expand file tree Collapse file tree 4 files changed +44
-21
lines changed Expand file tree Collapse file tree 4 files changed +44
-21
lines changed Original file line number Diff line number Diff line change 27
27
28
28
dependencies :
29
29
- lowest
30
- # - locked
31
30
- highest
32
31
33
32
steps :
@@ -38,13 +37,32 @@ jobs:
38
37
if : matrix.dependencies == 'lowest'
39
38
run : ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest
40
39
41
- # - name: "Install locked dependencies with composer"
42
- # if: matrix.dependencies == 'locked'
43
- # run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest
44
-
45
40
- name : " Install highest dependencies with composer"
46
41
if : matrix.dependencies == 'highest'
47
42
run : ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest
48
43
49
44
- name : " Run unit tests with phpunit"
50
- run : ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml
45
+ run : ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml --no-coverage
46
+
47
+
48
+ code-coverage :
49
+ name : " Code Coverage"
50
+ runs-on : ubuntu-latest
51
+
52
+ steps :
53
+ - name : " Checkout"
54
+
55
+
56
+ - name : " Install locked dependencies with composer"
57
+ run : php7.3 $(which composer) install --no-interaction --no-progress --no-suggest
58
+
59
+ - name : " Dump Xdebug filter with phpunit/phpunit"
60
+ run : php7.3 vendor/bin/phpunit --configuration=phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php
61
+
62
+ - name : " Collect code coverage with Xdebug and phpunit/phpunit"
63
+ run : php7.3 vendor/bin/phpunit --configuration=phpunit.xml --prepend=.build/phpunit/xdebug-filter.php
64
+
65
+ - name : " Send code coverage report to Codecov.io"
66
+ env :
67
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
68
+ run : bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change 1
- vendor
2
- .idea
3
- tests / Output / output_test. *
1
+ .build / *
2
+ .idea / *
3
+ vendor / *
4
4
composer.lock
5
- * .phpunit.result.cache
Original file line number Diff line number Diff line change 1
- <?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <phpunit backupGlobals =" false"
3
- backupStaticAttributes =" false"
1
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd"
4
3
bootstrap =" vendor/autoload.php"
4
+ cacheResultFile =" .build/phpunit.result.cache"
5
5
colors =" true"
6
- convertErrorsToExceptions =" true"
7
- convertNoticesToExceptions =" true"
8
- convertWarningsToExceptions =" true"
9
- processIsolation =" false"
10
- stopOnFailure =" false"
6
+ verbose =" true"
11
7
>
12
8
<filter >
13
9
<whitelist processUncoveredFilesFromWhitelist =" true" >
19
15
<directory suffix =" .php" >./tests/</directory >
20
16
</testsuite >
21
17
</testsuites >
18
+ <logging >
19
+ <log type =" coverage-clover" target =" .build/coverage/clover.xml" />
20
+ <log type =" coverage-xml" target =" .build/coverage/coverage-xml" />
21
+ <log type =" junit" target =" .build/logs/junit.xml" />
22
+ </logging >
22
23
</phpunit >
Original file line number Diff line number Diff line change 17
17
use chillerlan \QRCode \Output \{QRCodeOutputException , QROutputInterface };
18
18
use chillerlan \QRCodeTest \QRTestAbstract ;
19
19
20
- /**
21
- */
20
+ use function dirname , file_exists , mkdir ;
21
+
22
22
abstract class QROutputTestAbstract extends QRTestAbstract{
23
23
24
- const cachefile = __DIR__ .'/output_test. ' ;
24
+ const cachefile = __DIR__ .'/../../.build/ output_test/test . ' ;
25
25
26
26
/**
27
27
* @var \chillerlan\QRCode\Output\QROutputInterface
@@ -41,6 +41,11 @@ abstract class QROutputTestAbstract extends QRTestAbstract{
41
41
protected function setUp ():void {
42
42
parent ::setUp ();
43
43
44
+ $ buildDir = dirname ($ this ::cachefile);
45
+ if (!file_exists ($ buildDir )){
46
+ mkdir ($ buildDir , 0777 , true );
47
+ }
48
+
44
49
$ this ->options = new QROptions ;
45
50
$ this ->setOutputInterface ();
46
51
}
You can’t perform that action at this time.
0 commit comments