88 branches :
99 - main
1010 - ' feature/**'
11+ workflow_dispatch :
12+ inputs :
13+ enable_terminal :
14+ type : boolean
15+ description : ' Enable terminal session.'
16+ required : false
17+ default : false
1118
1219jobs :
1320 test-php :
1421 runs-on : ubuntu-latest
1522
1623 strategy :
1724 matrix :
18- php-versions : ['8.2', '8.3']
25+ php-versions : ['8.2', '8.3', '8.4' ]
1926
2027 steps :
2128 - name : Checkout code
3340 uses : shivammathur/setup-php@v2
3441 with :
3542 php-version : ${{ matrix.php-versions }}
43+ coverage : pcov
44+ ini-values : pcov.directory=.
3645
3746 - name : Setup SSH private key
3847 uses :
webfactory/[email protected] @@ -47,24 +56,41 @@ jobs:
4756 - name : Install dependencies
4857 run : composer install
4958
59+ - name : Validate composer.json
60+ run : |
61+ composer --verbose validate
62+ composer normalize --dry-run
63+
5064 - name : Check coding standards
5165 run : composer lint
66+ continue-on-error : ${{ vars.CI_LINT_IGNORE_FAILURE == '1' }}
5267
5368 - name : Run tests
54- run : XDEBUG_MODE=coverage composer test
69+ run : composer test-coverage
70+ continue-on-error : ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }}
5571
5672 - name : Upload coverage report as an artifact
5773 uses : actions/upload-artifact@v4
5874 with :
5975 name : ${{github.job}}-code-coverage-report-${{ matrix.php-versions }}
6076 path : ./.coverage-html
77+ include-hidden-files : true
78+ if-no-files-found : error
6179
6280 - name : Upload coverage report to Codecov
6381 uses : codecov/codecov-action@v5
82+ if : ${{ env.CODECOV_TOKEN != '' }}
6483 with :
6584 files : ./cobertura.xml
6685 fail_ci_if_error : true
6786 token : ${{ secrets.CODECOV_TOKEN }}
87+ env :
88+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
89+
90+ - name : Setup tmate session
91+ if : ${{ !cancelled() && github.event.inputs.enable_terminal }}
92+ uses : mxschmitt/action-tmate@v3
93+ timeout-minutes : 5
6894
6995 build-php :
7096 runs-on : ubuntu-latest
0 commit comments