From 6e3a311f7715c77f2648041150f4c398d6c58d21 Mon Sep 17 00:00:00 2001
From: Gilbertsoft <25326036+gilbertsoft@users.noreply.github.com>
Date: Thu, 14 Jul 2022 10:28:13 +0200
Subject: [PATCH] [TASK] Upload coverage to Coveralls (#343)
---
.github/workflows/continuous-integration.yml | 26 +++++++++++++++++++-
tests/Functional/phpunit.xml | 2 +-
tests/Unit/phpunit.xml | 2 +-
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 42dcb541..5d989d23 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -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()
@@ -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:
diff --git a/tests/Functional/phpunit.xml b/tests/Functional/phpunit.xml
index 7bd6d7f2..47745e67 100644
--- a/tests/Functional/phpunit.xml
+++ b/tests/Functional/phpunit.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/tests/Unit/phpunit.xml b/tests/Unit/phpunit.xml
index a9db86b1..c9fafe05 100644
--- a/tests/Unit/phpunit.xml
+++ b/tests/Unit/phpunit.xml
@@ -20,7 +20,7 @@
-
+