Skip to content

Commit 951b56d

Browse files
committed
update some for output coverage report
1 parent ad79f8f commit 951b56d

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.github/workflows/php.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ jobs:
1717
fail-fast: true
1818
matrix:
1919
php: [7.3, 7.4, 8.0] # 7.2,
20-
os: [ubuntu-latest, macOS-latest] # windows-latest,
20+
os: [ubuntu-latest] # , macOS-latest, windows-latest,
21+
coverage: ['none']
22+
include:
23+
- description: 'Log Code Coverage'
24+
php: '8.0'
25+
coverage: 'xdebug'
2126
# include: # will not testing on php 7.2
2227
# - os: 'ubuntu-latest'
2328
# php: '7.2'
@@ -36,38 +41,43 @@ jobs:
3641
- name: Display Env
3742
run: env
3843

44+
- uses: actions/cache@v2
45+
with:
46+
path: ~/.composer/cache/files
47+
key: ${{ matrix.php }}
48+
3949
# usage refer https://github.com/shivammathur/setup-php
4050
- name: Setup PHP
4151
timeout-minutes: 5
4252
uses: shivammathur/setup-php@v2
4353
with:
4454
php-version: ${{ matrix.php}}
45-
tools: pecl, php-cs-fixer, phpunit:${{ matrix.phpunit }}
46-
extensions: mbstring, dom, fileinfo, mysql, openssl, igbinary, redis # , swoole-4.4.19 #optional, setup extensions
47-
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
48-
coverage: none #optional, setup coverage driver: xdebug, none
55+
tools: php-cs-fixer, phpunit:${{ matrix.phpunit }} # pecl,
56+
extensions: mbstring # , swoole-4.4.19 #optional, setup extensions
57+
coverage: ${{ matrix.coverage }} #optional, setup coverage driver: xdebug, none
4958

5059
- name: Install dependencies
5160
run: composer update --no-progress
5261

5362
- name: Generate changelog file
5463
id: changelog
55-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.php == '7.4' }}
64+
if: ${{ matrix.php == '7.4' }}
5665
run: |
5766
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
5867
php kite.phar git cl last head --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md
5968
cat changelog.md
6069
6170
# phpunit -v --debug
71+
# phpdbg -dauto_globals_jit=Off -qrr $(which phpunit) --coverage-clover ./test/clover.info
6272
- name: Run test suite
6373
run: |
6474
php example/flags-demo.php -h
6575
php example/sflags-demo.php --help
66-
phpdbg -qrr $(which phpunit) --coverage-clover ./test/clover.info
76+
phpunit --coverage-clover ./test/clover.info
6777
6878
- name: Coveralls parallel
6979
uses: coverallsapp/github-action@master
70-
if: ${{ matrix.os == 'ubuntu-latest' }}
80+
if: matrix.coverage == 'xdebug'
7181
with:
7282
github-token: ${{ secrets.github_token }}
7383
path-to-lcov: ./test/clover.info

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
php-version: ${{ matrix.php}}
3434
tools: pecl, php-cs-fixer, phpunit
35-
extensions: mbstring, dom, fileinfo, mysql, openssl # , swoole-4.4.19 #optional, setup extensions
35+
extensions: mbstring, fileinfo, openssl # , swoole-4.4.19 #optional, setup extensions
3636
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
3737
coverage: none #optional, setup coverage driver: xdebug, none
3838

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,10 @@ phpunit --debug
498498
test with coverage:
499499

500500
```bash
501-
phpdbg -qrr $(which phpunit) --coverage-text
502-
phpdbg -qrr $(which phpunit) --coverage-clover ./test/clover.info
501+
phpdbg -dauto_globals_jit=Off -qrr $(which phpunit) --coverage-text
502+
phpdbg -dauto_globals_jit=Off -qrr $(which phpunit) --coverage-clover ./test/clover.info
503+
# use xdebug
504+
phpunit --coverage-clover ./test/clover.info
503505
```
504506

505507
## Project use

0 commit comments

Comments
 (0)