Skip to content

Commit 342b4a0

Browse files
ci: rework coveralls upload for unit tests with parallel+finish events; add config for coverage for integration tests; unify coverage paths & remove now obsolete clover script (#420)
1 parent 172cc0e commit 342b4a0

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,25 @@ jobs:
113113
run: composer audit
114114

115115
- name: Run unit test suite
116-
run: composer run-unit-tests-with-clover
116+
run: composer run-unit-tests
117117

118118
- name: Upload coverage results to Coveralls
119119
if: matrix.calculate-code-coverage == true
120120
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
121121
with:
122122
github-token: ${{ secrets.GITHUB_TOKEN }}
123+
file: ./var/logs/test-coverage/unit/clover.xml
124+
parallel: true
125+
flag-name: "Unit"
123126
fail-on-error: false
124-
base-path: ./var/logs/test-coverage/
125-
flag-name: "PHP ${{ matrix.php }}"
127+
128+
coveralls-finish:
129+
needs: tests
130+
if: always()
131+
runs-on: ubuntu-latest
132+
steps:
133+
- name: Finalize Coveralls parallel run
134+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
135+
with:
136+
github-token: ${{ secrets.GITHUB_TOKEN }}
137+
parallel-finished: true

.scrutinizer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ build:
88
tests:
99
override:
1010
- php-scrutinizer-run
11-
- command: composer run-unit-tests-with-clover
11+
- command: composer run-unit-tests
1212
coverage:
13-
file: var/logs/test-coverage/clover.xml
13+
file: var/logs/test-coverage/unit/clover.xml
1414
format: clover
1515

1616
dependencies:

ci/phpunit/config-integration.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
<directory>../../tests/Integration</directory>
2020
</testsuite>
2121
</testsuites>
22+
<coverage>
23+
<report>
24+
<html outputDirectory="../../var/logs/test-coverage/integration/html"/>
25+
<clover outputFile="../../var/logs/test-coverage/integration/clover.xml"/>
26+
</report>
27+
</coverage>
2228
<source>
2329
<include>
2430
<directory suffix=".php">../../src</directory>

ci/phpunit/config-unit.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
</testsuites>
2222
<coverage>
2323
<report>
24-
<html outputDirectory="../../var/coverage/html"/>
25-
<clover outputFile="../../var/coverage/clover.xml"/>
24+
<html outputDirectory="../../var/logs/test-coverage/unit/html"/>
25+
<clover outputFile="../../var/logs/test-coverage/unit/clover.xml"/>
2626
</report>
2727
</coverage>
2828
<source>

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@
102102
"run-unit-tests": [
103103
"@phpunit:unit"
104104
],
105-
"run-unit-tests-with-clover": [
106-
"@phpunit:unit --coverage-clover=./var/logs/test-coverage/clover.xml"
107-
],
108105
"run-all-tests": [
109106
"@run-unit-tests",
110107
"@run-integration-tests"

0 commit comments

Comments
 (0)