Skip to content

Commit

Permalink
test selfagency/merge-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarbous committed Dec 9, 2023
1 parent d704645 commit 41ef9c7
Showing 1 changed file with 19 additions and 37 deletions.
56 changes: 19 additions & 37 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,57 +68,39 @@ jobs:
configuration: "phpunit.xml.dist"

- name: upload coverage file
if: "github.event_name == 'pull_request'"
if: "${{github.event_name}} == 'pull_request'"
uses: actions/upload-artifact@v3
with:
name: coverage
path: Build
name: coverage
path: Build

- name: upload composer.lock on fail
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: "composer.${{ matrix.env.php }}.${{ matrix.env.symfony }}"
path: |
composer.json
composer.lock
name: "composer.${{ matrix.env.php }}.${{ matrix.env.symfony }}"
path: |
composer.json
composer.lock
coverage_report:
needs: test
runs-on: ubuntu-latest
if: "github.event_name == 'pull_request'"
if: "${{ github.event_name }} == 'pull_request'"
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: coverage
path: Build

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: 'install phpcov'
run: composer -n require --dev php-coveralls/php-coveralls

- name: 'merge coverage files'
run: vendor/bin/phpcov merge --cobertura cobertura.xml ./Build

- name: "Code Coverage Report"
uses: irongut/[email protected]
with:
filename: cobertura.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
path: coverage

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
- name: Merge coverage reports
id: coverage
uses: selfagency/[email protected]
with:
recreate: true
path: code-coverage-results.md
source: ${{ github.workspace }}/${{ inputs.package }}
coverage-reports: ${{ github.workspace }}/${{ inputs.package }}/coverage
output-folder: ${{ github.workspace }}/${{ inputs.package }}/coverage-reports
formats: clover
artifacts: true

0 comments on commit 41ef9c7

Please sign in to comment.