File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 6161 - name : " Install PHP"
6262 uses : " shivammathur/setup-php@v2"
6363 with :
64- coverage : " none "
64+ coverage : " xdebug "
6565 php-version : " ${{ matrix.php-version }}"
6666
6767 - name : " Install lowest dependencies"
7373 run : " composer update --no-interaction --no-progress"
7474
7575 - name : " Tests"
76- run : " composer test"
76+ id : tests
77+ continue-on-error : false
78+ run : |
79+ vendor/bin/phpunit --coverage-text --coverage-text=coverage.txt
80+ echo "::set-output name=coverage::$(cat coverage.txt | grep -Po '^\s*Lines:\s*\d+.\d+\%' | grep -Po '\d+.\d+')"
81+
82+ # TODO on pull request add comment?
83+
84+ - name : " Create badge"
85+ if : ${{ github.ref == 'refs/heads/main' && matrix.dependencies == 'highest' && steps.tests.outputs.coverage != '' }}
86+ uses : schneegans/dynamic-badges-action@v1.4.0
87+ with :
88+ auth : ${{ secrets.GIST_SECRET }}
89+ gistID : 11b884c06da0bf9116ae763d23438ecb
90+ filename : coverage.json
91+ label : Coverage
92+ # TODO colors?
93+ message : ${{ steps.tests.outputs.coverage }}
94+ color : success
7795
7896 static-analysis :
7997 name : " PHPStan"
Original file line number Diff line number Diff line change 22
33![ img] ( https://img.shields.io/badge/PHPStan-8-blue )
44![ php] ( https://img.shields.io/badge/PHP-8.1-B0B3D6 )
5+ ![ coverage] ( https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/pionl/11b884c06da0bf9116ae763d23438ecb/raw/coverage.json )
56
67Get typed (strict mode) values from an Array / XML with basic validation.
78
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ position: 1
66
77<img src =" https://img.shields.io/badge/PHPStan-8-blue " class =" inline-flex " style =" margin : 0 ;" />
88<img src =" https://img.shields.io/badge/PHP-8.1-B0B3D6 " class =" inline-flex " style =" margin : 0 ;" />
9+ <img src =" https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/pionl/11b884c06da0bf9116ae763d23438ecb/raw/coverage.json " class =" inline-flex " style =" margin : 0 ;" />
910
1011## Main features
1112
You can’t perform that action at this time.
0 commit comments