Skip to content

Commit

Permalink
#24 - preserve get-coverage.php scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-sz committed Feb 2, 2025
1 parent 098bfce commit b7b0a73
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/pr-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Run test suites with coverage on PR branch
run: |
mkdir -p var/coverage
cp scripts/get-coverage.php var/coverage/
php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-text --coverage-clover=var/coverage/clover-pr.xml
- name: Checkout main branch
Expand All @@ -57,17 +57,15 @@ jobs:
git fetch origin master
git checkout master
- name: Run test suites with coverage on main branch
- name: Run test suites with coverage on main branch. Ignore test result for the coverage purpose.
if: success()
run: |
mkdir -p var/coverage
php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-text --coverage-clover=var/coverage/clover-main.xml || true
run: php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-text --coverage-clover=var/coverage/clover-main.xml || true

- name: Extract coverage
if: success()
run: |
COVERAGE_PR=$(php scripts/get-coverage.php var/coverage/clover-pr.xml)
COVERAGE_MAIN=$(php scripts/get-coverage.php var/coverage/clover-main.xml)
COVERAGE_PR=$(php var/coverage/get-coverage.php var/coverage/clover-pr.xml)
COVERAGE_MAIN=$(php var/coverage/get-coverage.php var/coverage/clover-main.xml)
DIFF=$(echo "$COVERAGE_PR - $COVERAGE_MAIN" | bc)
DIFF_DISPLAY=$DIFF
if [ $(echo "$DIFF >= 0" | bc) -eq 1 ]; then
Expand Down

0 comments on commit b7b0a73

Please sign in to comment.