File tree Expand file tree Collapse file tree 6 files changed +132
-9
lines changed Expand file tree Collapse file tree 6 files changed +132
-9
lines changed Original file line number Diff line number Diff line change
1
+ name : " Merge Coverage Bis"
2
+
3
+ on : [pull_request]
4
+
5
+ env :
6
+ XDEBUG_MODE : coverage
7
+
8
+ jobs :
9
+ unit :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@master
13
+ - uses : php-actions/composer@master
14
+ - uses : php-actions/phpunit@master
15
+ with :
16
+ php_extensions : xdebug
17
+ testsuite : unit
18
+ coverage_php : reports/unit.php
19
+ - uses : actions/cache/save@v4
20
+ with :
21
+ path : reports
22
+ key : reports-unit-${{ github.run_id }}
23
+
24
+ integration :
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - uses : actions/checkout@master
28
+ - uses : php-actions/composer@master
29
+ - uses : php-actions/phpunit@master
30
+ with :
31
+ php_extensions : xdebug
32
+ testsuite : integration
33
+ coverage_php : reports/integration.php
34
+ - uses : actions/cache/save@v4
35
+ with :
36
+ path : reports
37
+ key : reports-integration-${{ github.run_id }}
38
+
39
+ coverage :
40
+ runs-on : ubuntu-latest
41
+ needs : [integration, unit]
42
+
43
+ steps :
44
+ - uses : actions/checkout@v4
45
+ - uses : actions/cache/restore@v4
46
+ with :
47
+ path : reports
48
+ key : reports-unit-${{ github.run_id }}
49
+ - uses : actions/cache/restore@v4
50
+ with :
51
+ path : reports
52
+ key : reports-integration-${{ github.run_id }}
53
+ - uses : php-actions/composer@master
54
+ - run : php bin/merge-coverage.php
55
+
56
+
Original file line number Diff line number Diff line change
1
+ name : " Merge Coverage"
2
+
3
+ on : [pull_request]
4
+
5
+ jobs :
6
+ unit :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : actions/checkout@v4
10
+ - uses : shivammathur/setup-php@v2
11
+ with :
12
+ tools : composer
13
+ coverage : xdebug
14
+ env :
15
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
16
+ - run : composer install
17
+ - run : vendor/bin/phpunit --testsuite unit --coverage-php reports/unit.php
18
+ - uses : actions/cache/save@v4
19
+ with :
20
+ path : reports
21
+ key : reports-unit-${{ github.run_id }}
22
+
23
+ integration :
24
+ runs-on : ubuntu-latest
25
+ steps :
26
+ - uses : actions/checkout@v4
27
+ - uses : shivammathur/setup-php@v2
28
+ with :
29
+ tools : composer
30
+ coverage : xdebug
31
+ env :
32
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33
+ - run : composer install
34
+ - run : vendor/bin/phpunit --testsuite integration --coverage-php reports/integration.php
35
+ - uses : actions/cache/save@v4
36
+ with :
37
+ path : reports
38
+ key : reports-integration-${{ github.run_id }}
39
+
40
+ coverage :
41
+ runs-on : ubuntu-latest
42
+ needs : [integration, unit]
43
+
44
+ steps :
45
+ - uses : actions/checkout@v4
46
+ - uses : actions/cache/restore@v4
47
+ with :
48
+ path : reports
49
+ key : reports-unit-${{ github.run_id }}
50
+ - uses : actions/cache/restore@v4
51
+ with :
52
+ path : reports
53
+ key : reports-integration-${{ github.run_id }}
54
+
55
+ - uses : shivammathur/setup-php@v2
56
+ with :
57
+ tools : composer
58
+ coverage : xdebug
59
+ env :
60
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61
+ - run : composer install
62
+ - run : php bin/merge-coverage.php
63
+
64
+
Original file line number Diff line number Diff line change 11
11
- name : Check out repository code
12
12
uses : actions/checkout@master
13
13
14
- - uses : php-actions/composer@master
14
+ - uses : php-actions/composer@master
15
15
16
16
- name : PHPUnit Tests
17
17
uses : php-actions/phpunit@master
Original file line number Diff line number Diff line change 1
1
# ## MacOs ###
2
2
.DS_Store
3
3
4
+ # ## PhpStorm ###
5
+ /.idea
6
+
4
7
# ## Composer ###
5
8
composer.lock
6
9
composer.phar
@@ -13,3 +16,4 @@ composer.phar
13
16
/reports
14
17
! /reports /.keep
15
18
/coverage
19
+
Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ test:
13
13
classnames.test :
14
14
docker compose exec php vendor/bin/phpunit --testsuite classnames
15
15
16
- unit.test :
16
+ unit.test : start
17
17
docker compose exec php vendor/bin/phpunit --testsuite unit --coverage-php reports/unit.php
18
18
19
- integration.test :
19
+ integration.test : start
20
20
docker compose exec php vendor/bin/phpunit --testsuite integration --coverage-php reports/integration.php
21
21
22
- merge-coverage :
22
+ merge-coverage : unit.test integration.test
23
23
docker compose exec php bin/merge-coverage.php
Original file line number Diff line number Diff line change 3
3
4
4
require __DIR__ .'/../vendor/autoload.php ' ;
5
5
6
- use \SebastianBergmann \CodeCoverage \CodeCoverage ;
7
- use \SebastianBergmann \CodeCoverage \Report \Html \CustomCssFile ;
8
6
use \SebastianBergmann \CodeCoverage \Report \Html \Facade as HtmlReport ;
9
7
use \PHPUnit \Runner \Version ;
10
8
9
+ $ reference = sprintf (' and <a href="https://phpunit.de/">PHPUnit %s</a> ' , Version::id ());
10
+ $ report = new HtmlReport ($ reference );
11
+
11
12
$ unit = include ('reports/unit.php ' );
12
13
$ integration = include ('reports/integration.php ' );
13
14
14
15
$ unit ->merge ($ integration );
15
16
16
- $ reference = sprintf (' and <a href="https://phpunit.de/">PHPUnit %s</a> ' , Version::id ());
17
-
18
- (new HtmlReport ($ reference ))->process ($ unit , 'coverage ' );
17
+ $ report ->process ($ unit , 'coverage ' );
19
18
20
19
21
20
You can’t perform that action at this time.
0 commit comments