From 530a1d0af9c1e34979263c9e18e54dc4826a09d0 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 13 Mar 2024 17:18:37 +0530 Subject: [PATCH 01/13] Add support for more recent version of PHP --- .gitignore | 1 + composer.json | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 45574d3..fbd7343 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ phpunit.phar /tests/docker /tests/dockerids +/.phplint.cache diff --git a/composer.json b/composer.json index a18a51d..02ce94b 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["yii2", "authclient", "oauth", "gitlab"], "homepage": "http://github.com/yiiauth/gitlab", "require": { - "php": "~7.3 || 8.0", + "php": "~7.3 || ~8.0", "yiisoft/yii2-authclient": "~2.1" }, "license": "MIT", @@ -24,5 +24,8 @@ "type": "composer", "url": "https://asset-packagist.org" } - ] + ], + "require-dev": { + "overtrue/phplint": "^9.0" + } } From f61692840bb2c9bab48d7558672dd3da83d6f3c7 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:19:20 +0530 Subject: [PATCH 02/13] Create php.yml GA --- .github/workflows/php.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..a7d195f --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,39 @@ +name: PHP Composer + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + # - name: Run test suite + # run: composer run-script test From aae2e8eca337c2b1eab4a96d4b2f5e79bc0dd755 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:27:39 +0530 Subject: [PATCH 03/13] Add Github Action --- .github/workflows/php.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a7d195f..b7d0e61 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -12,13 +12,19 @@ permissions: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + steps: - uses: actions/checkout@v3 - - name: Validate composer.json and composer.lock - run: composer validate --strict + # - name: Validate composer.json and composer.lock + # run: composer validate --strict - name: Cache Composer packages id: composer-cache @@ -35,5 +41,5 @@ jobs: # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" # Docs: https://getcomposer.org/doc/articles/scripts.md - # - name: Run test suite - # run: composer run-script test + - name: Run lint + run: ./vendor/bin/phplint path src From cf2ece62cc2a90861c78d882d7d59184abbcbc95 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:34:08 +0530 Subject: [PATCH 04/13] No plugin in composer to fix GA --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b7d0e61..9862dda 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -36,7 +36,7 @@ jobs: ${{ runner.os }}-php- - name: Install dependencies - run: composer install --prefer-dist --no-progress + run: composer install --prefer-dist --no-progress --no-plugins # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" # Docs: https://getcomposer.org/doc/articles/scripts.md From 7aa73b6c0b48421ad77b71f6b4dcce21561bc8de Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:35:52 +0530 Subject: [PATCH 05/13] Enhancements --- .github/workflows/php.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9862dda..1a60e08 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,4 +1,4 @@ -name: PHP Composer +name: Check for syntax errors on different PHP version on: push: @@ -17,15 +17,11 @@ jobs: matrix: operating-system: [ubuntu-latest] php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] - name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} - + name: PHP ${{ matrix.php-versions }} Lint on ${{ matrix.operating-system }} steps: - uses: actions/checkout@v3 - # - name: Validate composer.json and composer.lock - # run: composer validate --strict - - name: Cache Composer packages id: composer-cache uses: actions/cache@v3 @@ -38,8 +34,8 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress --no-plugins - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md + - name: Check PHP Version + run: php -v - name: Run lint run: ./vendor/bin/phplint path src From 6f5c8eba303e9a7cdbf798ac00b69cf392f93861 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:37:26 +0530 Subject: [PATCH 06/13] Attempt to fix error in GA --- .github/workflows/php.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1a60e08..b9f5683 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,8 +10,7 @@ permissions: contents: read jobs: - build: - + run: runs-on: ${{ matrix.operating-system }} strategy: matrix: From 2e6230bb69e1eb5de91838e01c928410c3873f98 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:39:12 +0530 Subject: [PATCH 07/13] Attempt 2 to fix error in GA --- .github/workflows/php-lint.yml | 19 ++++++++++++++++ .github/workflows/php.yml | 40 ---------------------------------- 2 files changed, 19 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/php-lint.yml delete mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml new file mode 100644 index 0000000..39789f2 --- /dev/null +++ b/.github/workflows/php-lint.yml @@ -0,0 +1,19 @@ +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + php-versions: ['7.2', '7.3'] + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: intl #optional + ini-values: "post_max_size=256M" #optional + - name: Check PHP Version + run: php -v diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index b9f5683..0000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Check for syntax errors on different PHP version - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -permissions: - contents: read - -jobs: - run: - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: [ubuntu-latest] - php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] - name: PHP ${{ matrix.php-versions }} Lint on ${{ matrix.operating-system }} - - steps: - - uses: actions/checkout@v3 - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-plugins - - - name: Check PHP Version - run: php -v - - - name: Run lint - run: ./vendor/bin/phplint path src From 66a2728fb8f00c5829b3f0471ae215a937f70479 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:39:39 +0530 Subject: [PATCH 08/13] Attempt 3 to fix error in GA --- .github/workflows/php-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index 39789f2..2a8c19c 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -8,9 +8,9 @@ jobs: name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@v3 with: php-version: ${{ matrix.php-versions }} extensions: intl #optional From 8b7ab1f82d8e280b8ada7835a7b7ef0b2ad4a002 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:43:07 +0530 Subject: [PATCH 09/13] Attempt 4 to fix error in GA --- .github/workflows/php-lint.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index 2a8c19c..aafef45 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -1,3 +1,14 @@ +name: Check for syntax errors on different PHP version + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + jobs: run: runs-on: ${{ matrix.operating-system }} From 92248c3412289c4f6014e0c90b934eb382d80338 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:48:18 +0530 Subject: [PATCH 10/13] Attempt 5 to fix error in GA --- .github/workflows/php-lint.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index aafef45..b3ed161 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -14,14 +14,14 @@ jobs: runs-on: ${{ matrix.operating-system }} strategy: matrix: - operating-system: [ubuntu-latest, windows-latest, macOS-latest] - php-versions: ['7.2', '7.3'] + operating-system: [ubuntu-latest] + php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP - uses: shivammathur/setup-php@v3 + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: intl #optional From 96af9e986f475fd60a682d149fccebb533ada392 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:50:19 +0530 Subject: [PATCH 11/13] Attempt 6 to fix error in GA --- .github/workflows/php-lint.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index b3ed161..bc4e699 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -16,15 +16,24 @@ jobs: matrix: operating-system: [ubuntu-latest] php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] - name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + name: PHP ${{ matrix.php-versions }} Lint on ${{ matrix.operating-system }} steps: - name: Checkout uses: actions/checkout@v4 + - name: Install PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: intl #optional ini-values: "post_max_size=256M" #optional + - name: Check PHP Version run: php -v + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-plugins + + - name: Run lint + run: ./vendor/bin/phplint path src + From cdb247e65240a24f16f0510f4561e855dec5a32a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:51:29 +0530 Subject: [PATCH 12/13] Attempt 7 to fix error in GA --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 02ce94b..b9640d9 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,6 @@ } ], "require-dev": { - "overtrue/phplint": "^9.0" + "overtrue/phplint": "*" } } From 00764d13148e60ef59a2645ee2268bfd7b8c8f10 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 14 Mar 2024 12:54:42 +0530 Subject: [PATCH 13/13] Cleanup --- .github/workflows/php-lint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index bc4e699..677ad87 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -25,8 +25,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: intl #optional - ini-values: "post_max_size=256M" #optional - name: Check PHP Version run: php -v