Skip to content

Commit aacea06

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

File tree

5 files changed

+127
-2
lines changed

5 files changed

+127
-2
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@v4
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@v4
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@v4
49+
- run: php bin/merge-coverage.php
50+
51+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
php-version: '8.1'
13+
tools: composer, phpunit:10
14+
coverage: xdebug
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
- run: composer install
18+
- run: phpunit --testsuite unit --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@v4
28+
- uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: '8.1'
31+
tools: composer, phpunit:10
32+
coverage: xdebug
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
- run: composer install
36+
- run: phpunit --testsuite integration --coverage-php reports/integration.php
37+
- uses: actions/cache/save@v4
38+
with:
39+
path: reports
40+
key: reports-integration-${{ github.run_id }}
41+
42+
coverage:
43+
runs-on: ubuntu-latest
44+
needs: [integration, unit]
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/cache/restore@v4
49+
with:
50+
path: reports
51+
key: reports-unit-${{ github.run_id }}
52+
- uses: actions/cache/restore@v4
53+
with:
54+
path: reports
55+
key: reports-integration-${{ github.run_id }}
56+
57+
- uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: '8.1'
60+
tools: composer, phpunit:10
61+
coverage: xdebug
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
- run: composer install
65+
- run: php bin/merge-coverage.php
66+
67+

.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@v4
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+

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"MergeCoverage\\": "src/merge-coverage"
77
}
88
},
9+
"require": {
10+
"php": "^8.1"
11+
},
912
"require-dev": {
10-
"phpunit/phpunit": "~11"
13+
"phpunit/phpunit": "~10"
1114
}
1215
}

0 commit comments

Comments
 (0)