Skip to content

Commit

Permalink
+ job phpunit with xdebug to upload artifact clover.xml @ workf…
Browse files Browse the repository at this point in the history
…lows/be_base.yml

* enable `opcache.jit` in `php.ini` @ actions/be/action.yml
* replace git ref in permalinks of github file from commit to tag @ actions
@ .github

* enable `pathCoverage` @ be/phpunit.xml
  • Loading branch information
n0099 committed Sep 16, 2024
1 parent 6eae08b commit e500b94
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
18 changes: 10 additions & 8 deletions .github/actions/be/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ runs:
with:
php-version: '8.3'
tools: cs2pr
# https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#jit-configuration
coverage: none
ini-values: opcache.enable_cli=1
coverage: none # https://github.com/shivammathur/setup-php/blob/2.31.1/README.md#disable-coverage
# https://github.com/shivammathur/setup-php/blob/2.31.1/README.md#jit-configuration
ini-values: >
opcache.enable_cli=1, opcache.memory_consumption=256,
opcache.jit=tracing, opcache.jit_buffer_size=64M
# https://github.com/shivammathur/setup-php/wiki/Php-extensions-loaded-on-windows-2022/aee619eb6d77e86b17a76d458316b41e58a3b677
extensions: fileinfo # league/flysystem-local@3.28.0 requires ext-fileinfo but it's not enabled by default on windows
env: # https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#force-update-setup
update: 'true'
# https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#problem-matchers
env:
update: 'true' # https://github.com/shivammathur/setup-php/blob/2.31.1/README.md#force-update-setup
# https://github.com/shivammathur/setup-php/blob/2.31.1/README.md#problem-matchers
- run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
working-directory: be
shell: bash

# https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#cache-composer-dependencies
# https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/examples.md#php---composer
# https://github.com/shivammathur/setup-php/blob/2.31.1/README.md#cache-composer-dependencies
# https://github.com/actions/cache/blob/v4.0.2/examples.md#php---composer
- id: get-composer-cache-dir
run: echo "path=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
working-directory: be
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/c#/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
# cache: true
# # https://github.com/actions/setup-node/issues/624#issuecomment-1328681525
# cache-dependency-path: ${{ github.workspace }}/c#/*/packages.lock.json
# in favor of https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/examples.md#c---nuget
# in favor of https://github.com/actions/cache/blob/v4.0.2/examples.md#c---nuget
# to allow saving cache even jobs failed

- id: cache-restore
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/fe/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
# cache: yarn
# # https://github.com/actions/setup-node/issues/624#issuecomment-1328681525
# cache-dependency-path: ${{ github.workspace }}/fe/yarn.lock
# in favor of https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/examples.md#node---yarn-2
# in favor of https://github.com/actions/cache/blob/v4.0.2/examples.md#node---yarn-2
# to allow saving cache even jobs failed

# https://github.com/actions/setup-node/issues/1027
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/be_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ defaults:
run:
working-directory: be
jobs:
phpunit:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- uses: shivammathur/setup-php@v2
with:
# https://bugs.php.net/bug.php?id=80608 https://github.com/swoole/swoole-src/issues/3986 https://github.com/php/php-src/pull/6640
# PHP Warning: JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled.
ini-values: opcache.jit_buffer_size=0
coverage: xdebug
# https://github.com/shivammathur/setup-php/blob/2.31.1/README.md#problem-matchers
- run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- run: ./vendor/bin/phpunit --coverage-clover clover.xml
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ inputs.runs-on }}-clover.xml
path: be/clover.xml
compression-level: 9

phpstan:
runs-on: ${{ inputs.runs-on }}
steps:
Expand Down
1 change: 1 addition & 0 deletions be/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
<env name="SESSION_DRIVER" value="array" />
<env name="TELESCOPE_ENABLED" value="false" />
</php>
<coverage pathCoverage="true" />
</phpunit>

0 comments on commit e500b94

Please sign in to comment.