From e500b94501c473cf7f77e40644637baee879ff54 Mon Sep 17 00:00:00 2001 From: n0099 Date: Mon, 16 Sep 2024 03:51:26 +0000 Subject: [PATCH] + job `phpunit` with `xdebug` to upload artifact `clover.xml` @ workflows/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 --- .github/actions/be/action.yml | 18 ++++++++++-------- .github/actions/c#/action.yml | 2 +- .github/actions/fe/action.yml | 2 +- .github/workflows/be_base.yml | 20 ++++++++++++++++++++ be/phpunit.xml | 1 + 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/actions/be/action.yml b/.github/actions/be/action.yml index f4751b6c..a23e65d4 100644 --- a/.github/actions/be/action.yml +++ b/.github/actions/be/action.yml @@ -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 diff --git a/.github/actions/c#/action.yml b/.github/actions/c#/action.yml index 14327046..c363efe5 100644 --- a/.github/actions/c#/action.yml +++ b/.github/actions/c#/action.yml @@ -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 diff --git a/.github/actions/fe/action.yml b/.github/actions/fe/action.yml index 94ecfa7a..ac4d9351 100644 --- a/.github/actions/fe/action.yml +++ b/.github/actions/fe/action.yml @@ -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 diff --git a/.github/workflows/be_base.yml b/.github/workflows/be_base.yml index ed154b00..2b0e2715 100644 --- a/.github/workflows/be_base.yml +++ b/.github/workflows/be_base.yml @@ -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: diff --git a/be/phpunit.xml b/be/phpunit.xml index 1e7399ad..1a2d721e 100644 --- a/be/phpunit.xml +++ b/be/phpunit.xml @@ -31,4 +31,5 @@ +