Skip to content

Commit f7e53a1

Browse files
committed
build():Extract code coverage from test script in composer.json into separate script and use it in github worflow
1 parent 23642d3 commit f7e53a1

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444
# Docs: https://getcomposer.org/doc/articles/scripts.md
4545

4646
- name: Run test suite
47-
run: composer run-script test
47+
run: composer run-script coverage

.github/workflows/phpunit_8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
# Docs: https://getcomposer.org/doc/articles/scripts.md
4848

4949
- name: Run test suite
50-
run: composer run-script test
50+
run: composer run-script coverage

.github/workflows/phpunit_9.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
# Docs: https://getcomposer.org/doc/articles/scripts.md
4848

4949
- name: Run test suite
50-
run: composer run-script test
50+
run: composer run-script coverage

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ composer.lock
1010

1111
/coverage
1212
/.phpunit.cache
13+
/coverage.xml

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"phpunit/phpunit": "^9"
3838
},
3939
"scripts": {
40-
"test": "@php vendor/bin/phpunit tests --coverage-html coverage --coverage-clover coverage.xml",
40+
"test": "@php vendor/bin/phpunit tests",
41+
"coverage": "@test --coverage-html coverage --coverage-clover coverage.xml",
4142
"php-version": "@php --version"
4243
}
4344
}

0 commit comments

Comments
 (0)