Skip to content

Commit 54b3c75

Browse files
committed
ci(merge-coverage): add workflow to prove it works
1 parent 16159ba commit 54b3c75

File tree

4 files changed

+120
-1
lines changed

4 files changed

+120
-1
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Merge Coverage Bis"
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
unit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- uses: php-actions/composer@master
11+
- uses: php-actions/phpunit@v6
12+
with:
13+
testsuite: unit
14+
coverage_php: reports/unit.php
15+
- uses: actions/cache/save@v4
16+
with:
17+
path: reports
18+
key: reports-unit-${{ github.run_id }}
19+
20+
integration:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@master
24+
- uses: php-actions/composer@master
25+
- uses: php-actions/phpunit@v6
26+
with:
27+
testsuite: integration
28+
coverage_php: reports/integration.php
29+
- uses: actions/cache/save@v4
30+
with:
31+
path: reports
32+
key: reports-integration-${{ github.run_id }}
33+
34+
coverage:
35+
runs-on: ubuntu-latest
36+
needs: [integration, unit]
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/cache/restore@v4
41+
with:
42+
path: reports
43+
key: reports-unit-${{ github.run_id }}
44+
- uses: actions/cache/restore@v4
45+
with:
46+
path: reports
47+
key: reports-integration-${{ github.run_id }}
48+
- uses: php-actions/composer@master
49+
- run: php bin/merge-coverage.php
50+
51+

.github/workflows/merge-coverage.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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, phpunit:11
13+
coverage: xdebug
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
- run: composer install
17+
- run: 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, phpunit:11
30+
coverage: xdebug
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
- run: composer install
34+
- run: 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, phpunit:11
58+
coverage: xdebug
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
- run: composer install
62+
- run: php bin/merge-coverage.php
63+
64+

.github/workflows/phpunit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Check out repository code
1212
uses: actions/checkout@master
1313

14-
- uses: php-actions/composer@master
14+
- uses: php-actions/composer@master
1515

1616
- name: PHPUnit Tests
1717
uses: php-actions/phpunit@master

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
### MacOs ###
22
.DS_Store
33

4+
### PhpStorm ###
5+
/.idea
6+
47
### Composer ###
58
composer.lock
69
composer.phar
@@ -13,3 +16,4 @@ composer.phar
1316
/reports
1417
!/reports/.keep
1518
/coverage
19+

0 commit comments

Comments
 (0)