From e2b0368cf3599421837c194f1d36c7e482ffeea2 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 8 Jul 2026 11:26:35 +0200 Subject: [PATCH 1/3] CI : PHPStan with common action --- .github/workflows/php.yml | 58 +++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2b056dd..f35eed7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,6 +1,7 @@ name: PHP tests on: [push, pull_request] jobs: + # Check there is no syntax errors in the project php-linter: name: PHP Syntax check 7.2 => 8.5 runs-on: ubuntu-latest @@ -45,14 +46,14 @@ jobs: with: php-version: '7.4' - # Run PHPStan against the module (PHP 7.2 – 8.1) - phpstan-74: - name: PHPStan (PHP 7.2 - 8.1) + # Run PHPStan against the module (PHP 7.4 – PS 8.2) + phpstan-74-81: + name: PHPStan (PHP 7.4 - 8.1) runs-on: ubuntu-latest strategy: matrix: presta_version: ['8.2.x'] - php_version: ['7.2', '8.1'] + php_version: ['7.4', '8.1'] fail-fast: false env: PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini @@ -81,21 +82,48 @@ jobs: phpstan-version: '^0.12' composer-version: '2.2.18' + # Run PHPStan against the module (PHP 8.1 – 8.4) + phpstan-81-84: + name: PHPStan (PHP 8.1 - 8.4) + runs-on: ubuntu-latest + strategy: + matrix: + presta_version: ['9.0.3'] + php_version: ['8.1', '8.4'] + fail-fast: false + env: + PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + path: ${{ github.event.repository.name }} + + - name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap) + run: | + mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini + { + echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php" + echo "memory_limit=512M" + } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini + + - name: Run PHPStan + uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master + with: + php-version: ${{ matrix.php_version }} + presta-version: ${{ matrix.presta_version }} + module-name: ${{ github.event.repository.name }} + phpstan-level: '5' + phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon + # Run PHPStan against the module (PHP 8.1 – 8.5) phpstan: name: PHPStan (PHP 8.1 - 8.5) runs-on: ubuntu-latest strategy: matrix: - include: - # PrestaShop 9.0.x supports PHP 8.1 up to 8.4 (8.5 is not supported) - - { presta_version: '9.0.3', php_version: '8.1' } - - { presta_version: '9.0.3', php_version: '8.4' } - # PrestaShop 9.1.x and develop support PHP 8.1 up to 8.5 - - { presta_version: '9.1.x', php_version: '8.1' } - - { presta_version: '9.1.x', php_version: '8.5' } - - { presta_version: 'develop', php_version: '8.1' } - - { presta_version: 'develop', php_version: '8.5' } + presta_version: ['9.1.x', 'develop'] + php_version: ['8.1', '8.5'] fail-fast: false env: PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini @@ -105,7 +133,7 @@ jobs: with: path: ${{ github.event.repository.name }} - - name: Prepare PHP env for PrestaShop ${{ matrix.presta_version }} (define constants before any bootstrap) + - name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap) run: | mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini { @@ -120,4 +148,4 @@ jobs: presta-version: ${{ matrix.presta_version }} module-name: ${{ github.event.repository.name }} phpstan-level: '5' - phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon + phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon \ No newline at end of file From 78fbd8c908d05a81d51858ba1895c3c2e88b62e1 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 8 Jul 2026 11:29:17 +0200 Subject: [PATCH 2/3] Support for PrestaShop 8.2.x, 9.1.x, develop& Cleanup of all dead code --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ff6d58e..40be10a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Enrich your stats, display the pages requested by your visitors that could not b ## Compatibility -PrestaShop: `1.7.7.0` or later +PrestaShop: `8.2.0` or later ## Reporting issues From 07ec2d0108f94f6d1cbdd68d092af5f906a1ebe0 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 8 Jul 2026 11:30:08 +0200 Subject: [PATCH 3/3] CI : Dependabot (PHP / Node / Github Actions) --- .github/dependabot.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e1818d4..1ebf2ce 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,20 @@ version: 2 updates: -- package-ecosystem: npm +- package-ecosystem: composer directory: "/" schedule: interval: daily time: "04:00" open-pull-requests-limit: 10 target-branch: dev -- package-ecosystem: composer +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 + target-branch: dev +- package-ecosystem: npm directory: "/" schedule: interval: daily