Merge pull request #123 from Touxten/switched-ci-to-externeal--action #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PHP tests | |
| on: [push, pull_request] | |
| jobs: | |
| php-linter: | |
| name: PHP Syntax check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: PHP syntax checker 7.2 | |
| uses: prestashop/github-action-php-lint/7.2@master | |
| - name: PHP syntax checker 7.4 | |
| uses: prestashop/github-action-php-lint/7.4@master | |
| - name: PHP syntax checker 8.0 | |
| uses: prestashop/github-action-php-lint/8.0@master | |
| - name: PHP syntax checker 8.5 | |
| uses: prestashop/github-action-php-lint/8.5@master | |
| # Check the PHP code follow the coding standards | |
| php-cs-fixer: | |
| name: PHP-CS-Fixer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Run PHP-CS-Fixer | |
| uses: PrestaShop/.github/.github/actions/php-ci/php-cs@master | |
| with: | |
| php-version: '7.4' | |
| # Run PHPStan against the module (PHP 7.4 – 8.1) | |
| phpstan-74: | |
| name: PHPStan (PHP 7.4 - 8.1) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| presta_version: ['8.1.7', '8.2.x'] | |
| php_version: ['7.4', '8.1'] | |
| 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 8 (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 | |
| phpstan-version: '^0.12' | |
| composer-version: '2.2.18' | |
| # Run PHPStan against the module (PHP 8.1 – 8.4) | |
| phpstan-80-84: | |
| name: PHPStan (PHP 8.1 - 8.4 ) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| presta_version: ['9.0.x'] | |
| 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.0.x (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: | |
| 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 | |
| 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 |