Fix PHPUnit segfault in build checks with PHP 7.4 #355
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main, dev ] | |
pull_request: | |
branches: [ main, dev ] | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: ['7.4', '8.0', '8.1', '8.2'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP and Xdebug for Code Coverage report | |
uses: shivammathur/setup-php@v2 | |
if: ${{ matrix.php-versions == '8.0' }} | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: xdebug | |
- name: Setup PHP without Xdebug | |
uses: shivammathur/setup-php@v2 | |
if: ${{ matrix.php-versions != '8.0' }} | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: none | |
- name: Install dependencies | |
run: composer install | |
- name: Run static analysis | |
run: ./vendor/bin/phpstan | |
- name: Run tests without coverage | |
if: ${{ matrix.php-versions != '8.0' }} | |
run: ./vendor/bin/phpunit | |
- name: Run tests with coverage | |
if: ${{ matrix.php-versions == '8.0' }} | |
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml | |
- name: Fix code coverage paths | |
if: ${{ matrix.php-versions == '8.0' }} | |
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml | |
- name: SonarCloud Scan | |
if: ${{ matrix.php-versions == '8.0' && !github.event.pull_request.head.repo.fork }} | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |