Skip to content

Commit 1a6c89c

Browse files
committed
Run code coverage only for php 8
1 parent 11cbe70 commit 1a6c89c

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/pr-validation.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,34 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
php-versions: ['7.4', '8.0', '8.1', '8.2']
21+
php-versions: ['7.4', '8.1', '8.2', '8.3']
2222
steps:
2323
- uses: actions/[email protected]
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
2426
with:
25-
submodules: 'true'
27+
php-version: ${{ matrix.php-versions }}
28+
coverage: none
29+
- name: Validate composer file
30+
run: |
31+
composer validate
32+
- name: Install dependencies
33+
run: |
34+
composer install
35+
- name: Run tests
36+
run: ./vendor/bin/phpunit
37+
- name: Run static analysis
38+
run: |
39+
vendor/bin/phpstan analyse --memory-limit=500M --error-format=github
40+
41+
code-coverage:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/[email protected]
2645
- name: Setup PHP and Xdebug for Code Coverage report
2746
uses: shivammathur/setup-php@v2
2847
with:
29-
php-version: ${{ matrix.php-versions }}
48+
php-version: '8.0'
3049
coverage: xdebug
3150
- name: Validate composer file
3251
run: |
@@ -39,20 +58,17 @@ jobs:
3958
- name: Fix code coverage paths
4059
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
4160
- name: SonarCloud Scan
42-
if: ${{ matrix.php-versions == '8.0' && !github.event.pull_request.head.repo.fork }}
61+
if: ${{ !github.event.pull_request.head.repo.fork }}
4362
uses: SonarSource/sonarcloud-github-action@master
4463
env:
4564
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4665
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
47-
- name: Run static analysis
48-
run: |
49-
vendor/bin/phpstan analyse --memory-limit=500M --error-format=github
5066

5167
# The check-php-version-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
5268
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
5369
check-php-version-matrix:
5470
runs-on: ubuntu-latest
55-
needs: validate-pull-request
71+
needs: [validate-pull-request, code-coverage]
5672
if: always()
5773
steps:
5874
- name: All build matrix options are successful

0 commit comments

Comments
 (0)