Skip to content

Commit db4e370

Browse files
committed
Address Copilot CI feedback from #11 (#12)
Declare php ^8.2, lock-aware validate/install, cache key includes lock, --no-interaction.
1 parent 70cd9bd commit db4e370

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,29 @@ jobs:
2929
tools: composer:v2
3030

3131

32-
- name: Validate composer.json
33-
run: composer validate --strict --no-check-lock
32+
- name: Validate Composer metadata
33+
run: |
34+
if [ -f composer.lock ]; then
35+
composer validate --strict --no-interaction
36+
else
37+
composer validate --strict --no-check-lock --no-interaction
38+
fi
3439
3540
- name: Cache Composer packages
3641
uses: actions/cache@v4
3742
with:
3843
path: vendor
39-
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
44+
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json', '**/composer.lock') }}
4045
restore-keys: |
4146
${{ runner.os }}-composer-${{ matrix.php-versions }}-
4247
4348
- name: Install dependencies
44-
run: composer update --prefer-dist --no-progress
49+
run: |
50+
if [ -f composer.lock ]; then
51+
composer install --prefer-dist --no-progress --no-interaction
52+
else
53+
composer update --prefer-dist --no-progress --no-interaction
54+
fi
4555
4656
- name: Run test suite
4757
run: vendor/bin/phpunit

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"docs": "https://portphp.readthedocs.org"
2424
},
2525
"require": {
26+
"php": "^8.2",
2627
"portphp/portphp": "^1.6.0"
2728
},
2829
"autoload": {

0 commit comments

Comments
 (0)