From adcaafd75b8d365b296347c914f2e8f972849425 Mon Sep 17 00:00:00 2001 From: Meltir Date: Sat, 20 Jan 2024 19:32:54 +0000 Subject: [PATCH 1/3] Update PHP workflow to use matrix strategy The workflow file has been updated to use matrix strategy which will enable running tests on multiple versions of PHP. This change not only increases the coverage of our build tests but also ensures our application stays compatible with future PHP releases. Further, the output hash now also includes the version of PHP being used. --- .github/workflows/php.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 6419b11..5e4bda3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,13 +16,16 @@ jobs: # runs-on: self-hosted permissions: checks: write + strategy: + matrix: + version: [ 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ matrix.version }} - name: Validate composer.json and composer.lock run: composer validate --strict --no-check-lock @@ -32,7 +35,8 @@ jobs: run: | COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40` DATE=`date -u "+%Y%m%d"` - echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT" + VERSION="${{ matrix.version }}" + echo "hash=$COMPOSER_HASH$DATE$VERSION" >> "$GITHUB_OUTPUT" shell: bash - name: Cache Composer dependencies From 728482ad33f1263273cddc3bc12411e77383af9f Mon Sep 17 00:00:00 2001 From: Meltir Date: Sat, 20 Jan 2024 19:35:02 +0000 Subject: [PATCH 2/3] Update minimum PHP version in composer.json The 'require' section of composer.json has been updated to specify a minimum PHP version of 8.1. This simplifies and clarifies the version requirement, and is in line with our project's support for PHP 8.1 and above. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index edaabeb..f53e162 100644 --- a/composer.json +++ b/composer.json @@ -94,7 +94,7 @@ }, "minimum-stability": "stable", "require": { - "php": ">=8.0 >=8.1 >=8.2 >=8.3", + "php": ">=8.1", "symfony/dom-crawler": "5.4.* | 6.3.* | 7.0.*", "symfony/css-selector": "5.4.* | 6.4.* | 7.0.*", "psr/http-client": "^1.0", From 93b3d4fd301d87d225903a13c35fb46890f2233a Mon Sep 17 00:00:00 2001 From: Meltir Date: Sat, 20 Jan 2024 19:40:50 +0000 Subject: [PATCH 3/3] Same updates to other workflows. --- .github/workflows/infection.yml | 8 ++++++-- .github/workflows/phpcsfixer.yml | 8 ++++++-- .github/workflows/phpinsights.yml | 8 ++++++-- .github/workflows/phpstan.yml | 8 ++++++-- .github/workflows/phpunit.yml | 8 ++++++-- 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml index c7407db..a814387 100644 --- a/.github/workflows/infection.yml +++ b/.github/workflows/infection.yml @@ -16,20 +16,24 @@ jobs: name: Infection permissions: checks: write + strategy: + matrix: + version: [ 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ matrix.version }} - name: Cache hash id: get-cache-hash run: | COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40` DATE=`date -u "+%Y%m%d"` - echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT" + VERSION="${{ matrix.version }}" + echo "hash=$COMPOSER_HASH$DATE$VERSION" >> "$GITHUB_OUTPUT" shell: bash - name: Cache Composer dependencies diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 717e180..e60beb8 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -15,20 +15,24 @@ jobs: name: Check coding style permissions: checks: write + strategy: + matrix: + version: [ 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ matrix.version }} - name: Cache hash id: get-cache-hash run: | COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40` DATE=`date -u "+%Y%m%d"` - echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT" + VERSION="${{ matrix.version }}" + echo "hash=$COMPOSER_HASH$DATE$VERSION" >> "$GITHUB_OUTPUT" shell: bash - name: Cache Composer dependencies diff --git a/.github/workflows/phpinsights.yml b/.github/workflows/phpinsights.yml index 60d9f81..fbd1b2b 100644 --- a/.github/workflows/phpinsights.yml +++ b/.github/workflows/phpinsights.yml @@ -13,20 +13,24 @@ jobs: insights: runs-on: ubuntu-latest name: Check insights + strategy: + matrix: + version: [ 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ matrix.version }} - name: Cache hash id: get-cache-hash run: | COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40` DATE=`date -u "+%Y%m%d"` - echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT" + VERSION="${{ matrix.version }}" + echo "hash=$COMPOSER_HASH$DATE$VERSION" >> "$GITHUB_OUTPUT" shell: bash - name: Cache Composer dependencies diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 2e889bc..56cdd7d 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -13,20 +13,24 @@ jobs: standards: runs-on: ubuntu-latest name: Check standards + strategy: + matrix: + version: [ 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ matrix.version }} - name: Cache hash id: get-cache-hash run: | COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40` DATE=`date -u "+%Y%m%d"` - echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT" + VERSION="${{ matrix.version }}" + echo "hash=$COMPOSER_HASH$DATE$VERSION" >> "$GITHUB_OUTPUT" shell: bash - name: Cache Composer dependencies diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 6b53f24..2f7b914 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -14,20 +14,24 @@ jobs: runs-on: ubuntu-latest permissions: checks: write + strategy: + matrix: + version: [ 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ matrix.version }} - name: Cache hash id: get-cache-hash run: | COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40` DATE=`date -u "+%Y%m%d"` - echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT" + VERSION="${{ matrix.version }}" + echo "hash=$COMPOSER_HASH$DATE$VERSION" >> "$GITHUB_OUTPUT" shell: bash - name: Cache Composer dependencies