Skip to content

Commit

Permalink
Update phpunit-coverage.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
obenland committed Nov 9, 2024
1 parent 84d4278 commit 4eebf4b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/phpunit-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
run: |
# Run tests and capture coverage output
coverage_output=$(npm run test-php-coverage -- --coverage-text)
# Extract only the coverage report section
filtered_output=$(echo "$coverage_output" | sed -n '/^Code Coverage Report:/,$p')
# Extract only the coverage report section and format it
filtered_output=$(echo "$coverage_output" | sed -n '/^Code Coverage Report:/,$p' | sed '1 s/^/## /' | sed '/^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/d' | sed '/^Summary:/s/^/### /')
echo "$filtered_output" | tee coverage-summary.txt
echo "coverage_summary<<EOF" >> $GITHUB_ENV
echo "$filtered_output" >> $GITHUB_ENV
Expand All @@ -57,15 +57,12 @@ jobs:
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: PHPUnit Coverage Report
body-includes: Code Coverage Report

- name: Create or Update Comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## PHPUnit Coverage Report
${{ env.coverage_summary }}
body: ${{ env.coverage_summary }}
edit-mode: replace

0 comments on commit 4eebf4b

Please sign in to comment.