From fb130aa369067a0d00f28c37c4a17c955c04cf51 Mon Sep 17 00:00:00 2001 From: Janez Urevc Date: Wed, 22 Jul 2026 13:13:18 +0200 Subject: [PATCH 1/3] Address Copilot CI feedback from #11 - Validate composer.lock when present - Include composer.lock in cache key hash - Declare php >=8.2 to match the CI matrix --- .github/workflows/test.yml | 9 +++++++-- composer.json | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81e599c..3fb1755 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,13 +30,18 @@ jobs: - name: Validate composer.json - run: composer validate --strict --no-check-lock + run: | + if [ -f composer.lock ]; then + composer validate --strict + else + composer validate --strict --no-check-lock + fi - name: Cache Composer packages uses: actions/cache@v4 with: path: vendor - key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json', '**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer-${{ matrix.php-versions }}- diff --git a/composer.json b/composer.json index 0b7f00f..342e833 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,7 @@ "docs": "https://portphp.readthedocs.org" }, "require": { + "php": ">=8.2", "portphp/portphp": "^1.6.0" }, "autoload": { From 43acb9c358dc802db06ce53bc1565d39581689a8 Mon Sep 17 00:00:00 2001 From: Janez Urevc Date: Wed, 22 Jul 2026 13:16:51 +0200 Subject: [PATCH 2/3] Apply additional Copilot feedback on PHP constraint and install - Use ^8.2 instead of >=8.2 so Composer does not accept PHP 9+ by default - Prefer composer install when a lockfile is present --- .github/workflows/test.yml | 7 ++++++- composer.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3fb1755..b40be88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,7 +46,12 @@ jobs: ${{ runner.os }}-composer-${{ matrix.php-versions }}- - name: Install dependencies - run: composer update --prefer-dist --no-progress + run: | + if [ -f composer.lock ]; then + composer install --prefer-dist --no-progress + else + composer update --prefer-dist --no-progress + fi - name: Run test suite run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 342e833..3b64ae3 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "docs": "https://portphp.readthedocs.org" }, "require": { - "php": ">=8.2", + "php": "^8.2", "portphp/portphp": "^1.6.0" }, "autoload": { From d033b73d5975ddee9c0cebe416518bf725754b2a Mon Sep 17 00:00:00 2001 From: Janez Urevc Date: Wed, 22 Jul 2026 13:20:23 +0200 Subject: [PATCH 3/3] CI polish from Copilot: non-interactive Composer, clearer step name - Pass --no-interaction on composer validate/install/update - Rename validate step to reflect lockfile handling --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b40be88..7784970 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,12 +29,12 @@ jobs: tools: composer:v2 - - name: Validate composer.json + - name: Validate Composer metadata run: | if [ -f composer.lock ]; then - composer validate --strict + composer validate --strict --no-interaction else - composer validate --strict --no-check-lock + composer validate --strict --no-check-lock --no-interaction fi - name: Cache Composer packages @@ -48,9 +48,9 @@ jobs: - name: Install dependencies run: | if [ -f composer.lock ]; then - composer install --prefer-dist --no-progress + composer install --prefer-dist --no-progress --no-interaction else - composer update --prefer-dist --no-progress + composer update --prefer-dist --no-progress --no-interaction fi - name: Run test suite