Skip to content

Commit

Permalink
[TASK] Upload coverage to Coveralls (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertsoft authored Jul 14, 2022
1 parent aabaf8c commit 6e3a311
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,16 @@ jobs:
if: always()
run: composer ci:tests:php:functional

- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: php-${{ matrix.php-version }}-${{ matrix.dependencies }}
run: |
composer exec phpcov -- merge --clover var/log/coverage/clover.xml var/log/coverage
composer global require ${{ env.COMPOSER_INSTALL_FLAGS }} ${{ env.COMPOSER_FLAGS }} php-coveralls/php-coveralls
composer global exec php-coveralls -- --coverage_clover=var/log/coverage/clover.xml -vvv --json_path=var/log/coverage/coveralls-upload.json
- name: Upload Logs
uses: actions/upload-artifact@v3
if: always()
Expand All @@ -547,10 +557,24 @@ jobs:
path: var/log
retention-days: 7


coveralls-finish:
name: Finish Coveralls
needs:
- tests
runs-on: ubuntu-latest

steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

deployment:
name: Deployment
needs:
- tests
- coveralls-finish
if: ${{ github.event_name == 'push' }}
uses: ./.github/workflows/deployment.yml
secrets:
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</include>
<report>
<html outputDirectory="../../var/log/report-functional"/>
<php outputFile="../../var/log/cov/coverage-functional.cov"/>
<php outputFile="../../var/log/coverage/coverage-functional.cov"/>
</report>
</coverage>
<php>
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</include>
<report>
<html outputDirectory="../../var/log/report-unit"/>
<php outputFile="../../var/log/cov/coverage-unit.cov"/>
<php outputFile="../../var/log/coverage/coverage-unit.cov"/>
</report>
</coverage>
<testsuites>
Expand Down

0 comments on commit 6e3a311

Please sign in to comment.