Skip to content

Commit

Permalink
Switch action method
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondeJK committed Feb 3, 2025
1 parent 63297e3 commit 0b2d335
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,8 @@ jobs:
- name: Run PHPStan
run: ./vendor/bin/phpstan

- name: Check code coverage threshold
run: |
min_coverage=80
coverage=$(php -r "echo simplexml_load_file('coverage.xml')->project->metrics['elements'] > 0 ? (simplexml_load_file('coverage.xml')->project->metrics['coveredelements'] / simplexml_load_file('coverage.xml')->project->metrics['elements'] * 100) : 0;")
echo "Coverage: $coverage%"
if (( $(echo "$coverage < $min_coverage" | bc -l) )); then
echo "Code coverage is below $min_coverage%. Failing the build."
exit 1
fi
- name: Coverage Check
uses: ericsizemore/[email protected]
with:
clover_file: 'coverage.xml'
threshold: 80
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ jobs:
- name: Run codecov
uses: codecov/codecov-action@v1

- name: Check code coverage threshold
run: |
min_coverage=80
coverage=$(php -r "echo simplexml_load_file('coverage.xml')->project->metrics['elements'] > 0 ? (simplexml_load_file('coverage.xml')->project->metrics['coveredelements'] / simplexml_load_file('coverage.xml')->project->metrics['elements'] * 100) : 0;")
echo "Coverage: $coverage%"
if (( $(echo "$coverage < $min_coverage" | bc -l) )); then
echo "Code coverage is below $min_coverage%. Failing the build."
exit 1
fi
- name: Coverage Check
uses: ericsizemore/[email protected]
with:
clover_file: 'coverage.xml'
threshold: 80

0 comments on commit 0b2d335

Please sign in to comment.