Skip to content

Commit 6b82395

Browse files
committed
Update Composer script and enhance PHP 8.2 workflow
- Updated `type` coverage script in `composer.json` to include `--do-not-cache-result` option. - Improved GitHub Actions workflow for PHP 8.2, adding Composer validation, caching, style checks, static analysis (Psalm), and separate steps for type and test coverage execution. - Adjusted PHP setup to specify version `8.2.16` and include necessary extensions.
1 parent cec2197 commit 6b82395

File tree

2 files changed

+32
-19
lines changed

2 files changed

+32
-19
lines changed

.github/workflows/downgrade-php74.yml

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
name: Verify PHP 8.2 Release
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Check out source
16-
uses: actions/checkout@v4
15+
- uses: actions/checkout@v4
1716
with:
1817
fetch-depth: 0
1918

@@ -26,27 +25,41 @@ jobs:
2625
exit 1
2726
fi
2827
29-
- name: Setup PHP 8.2
28+
- name: Setup PHP
3029
uses: shivammathur/setup-php@v2
3130
with:
32-
php-version: '8.2'
33-
coverage: xdebug
34-
tools: composer:v2
31+
php-version: '8.2.16'
32+
extensions: mbstring, intl
33+
34+
- name: Validate composer.json and composer.lock
35+
run: composer validate --strict
36+
37+
- name: Cache Composer packages
38+
id: composer-cache
39+
uses: actions/cache@v3
40+
with:
41+
path: vendor
42+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-php-
3545
3646
- name: Install dependencies
37-
run: composer install --no-interaction --prefer-dist --no-progress
47+
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
3848

39-
- name: Run checks (cs, psalm, tests, type, coverage, mutate)
40-
env:
41-
XDEBUG_MODE: coverage
42-
run: |
43-
composer validate --strict
44-
composer cs
45-
composer sca
46-
composer test
47-
composer type
48-
composer coverage
49-
composer mutate
49+
- name: Run style fixer
50+
run: composer run-script cs
51+
52+
- name: Run psalm
53+
run: composer run-script sca
54+
55+
- name: Run tests
56+
run: composer run-script test
57+
58+
- name: Run type coverage
59+
run: composer run-script type
60+
61+
- name: Run test coverage
62+
run: composer run-script coverage
5063

5164
downgrade-and-tag:
5265
name: Downgrade to PHP 7.4 and Tag v1.x

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"./vendor/bin/pest"
6060
],
6161
"type": [
62-
"./vendor/bin/pest --type-coverage --min=100"
62+
"./vendor/bin/pest --type-coverage --min=100 --do-not-cache-result"
6363
],
6464
"coverage": [
6565
"./vendor/bin/pest --coverage --min=100"

0 commit comments

Comments
 (0)