File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454 php_version : ${{ matrix.php-version }}
5555 php_extensions : pcov
5656 command : ' dev-tools'
57- args : ' tests --coverage=public/coverage'
57+ args : ' tests --coverage=./ public/coverage'
5858
5959 - name : Ensure minimum code coverage
60- env :
61- MINIMUM_COVERAGE : 80
62- run : |
63- COVERAGE=$(php -r '
64- $xml = new SimpleXMLElement(file_get_contents("public/coverage/clover.xml"));
65- $m = $xml->project->metrics;
66- $pct = (int) round(((int) $m["coveredstatements"]) * 100 / (int) $m["statements"]);
67- echo $pct;
68- ')
69- echo "Coverage: ${COVERAGE}%"
70- if [ "${COVERAGE}" -lt ${{ env.MINIMUM_COVERAGE }} ]; then
71- echo "Code coverage below ${{ env.MINIMUM_COVERAGE }}% threshold."
72- exit 1
73- fi
60+ run : php vendor/bin/phpunit-coverage-check --min=80 ./public/coverage/clover.xml
Original file line number Diff line number Diff line change @@ -52,10 +52,22 @@ jobs:
5252 args : ' docs'
5353
5454 - name : Prepare wiki submodule branch
55+ id : wiki_branch
5556 working-directory : docs/wiki
5657 run : |
57- wiki_branch="main"
58- git fetch origin "$wiki_branch"
58+ git fetch origin
59+ wiki_branch="$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"
60+
61+ if [ -z "$wiki_branch" ]; then
62+ wiki_branch="$(git branch -r | sed 's/^[[:space:]]*origin\///' | grep -v '^HEAD$' | head -n 1)"
63+ fi
64+
65+ if [ -z "$wiki_branch" ]; then
66+ echo "Could not determine wiki branch" >&2
67+ exit 1
68+ fi
69+
70+ echo "branch=$wiki_branch" >> "$GITHUB_OUTPUT"
5971 git checkout -B "$wiki_branch" "origin/$wiki_branch"
6072
6173 - name : Commit & push wiki submodule
Original file line number Diff line number Diff line change 2828 "composer-plugin-api" : " ^2.0" ,
2929 "ergebnis/composer-normalize" : " ^2.50" ,
3030 "ergebnis/rector-rules" : " ^1.14" ,
31+ "esi/phpunit-coverage-check" : " ^3.0" ,
3132 "fakerphp/faker" : " ^1.24" ,
3233 "friendsofphp/php-cs-fixer" : " ^3.94" ,
3334 "phpdocumentor/shim" : " ^3.9" ,
You can’t perform that action at this time.
0 commit comments