Skip to content

Added SQL commands related to doctrine and remove Doctrine usage #1457

Added SQL commands related to doctrine and remove Doctrine usage

Added SQL commands related to doctrine and remove Doctrine usage #1457

Workflow file for this run

name: PHP tests
on: [push, pull_request]
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 5.6 => 8.1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.3
- name: PHP syntax checker 5.6
uses: prestashop/github-action-php-lint/5.6@master
with:
folder-to-exclude: "! -path \"./.github/*\" ! -path \"./classes/UpgradeTools/CoreUpgrader/CoreUpgrader8*\""
- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@master
with:
folder-to-exclude: "! -path \"./.github/*\""
- name: PHP syntax checker 7.3
uses: prestashop/github-action-php-lint/7.3@master
with:
folder-to-exclude: "! -path \"./.github/*\""
- name: PHP syntax checker 7.4
uses: prestashop/github-action-php-lint/7.4@master
with:
folder-to-exclude: "! -path \"./.github/*\""
- name: PHP syntax checker 8.0
uses: prestashop/github-action-php-lint/8.0@master
with:
folder-to-exclude: "! -path \"./.github/*\""
- name: PHP syntax checker 8.1
uses: prestashop/github-action-php-lint/8.1@master
with:
folder-to-exclude: "! -path \"./.github/*\""
# Check the PHP code follow the coding standards
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '5.6'
- name: Checkout
uses: actions/checkout@v4.1.3
- name: Cache dependencies
uses: actions/cache@v4.0.2
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
- name: Composer Install
run: composer install --prefer-dist
- name: Run PHP-CS-Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no
php-unit:
strategy:
matrix:
php-versions: ['5.6', '7.1', '7.2','7.4']
runs-on: ubuntu-latest
name: PHP Unit
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, ext-zip
- uses: actions/checkout@v4.1.3
with:
fetch-depth: 0
- run: composer install --prefer-dist
- run: ./vendor/phpunit/phpunit/phpunit tests
# Run PHPStan against the module and a PrestaShop release
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ['1.7.2.5', '1.7.3.4', '1.7.4.4', '1.7.5.1', '1.7.6', '1.7.7', '1.7.8', '8.0.0', 'latest']
steps:
- name: Checkout
uses: actions/checkout@v4.1.3
# Add vendor folder in cache to make next builds faster
- name: Cache vendor folder
uses: actions/cache@v4.0.2
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
# Add composer local folder in cache to make next builds faster
- name: Cache composer folder
uses: actions/cache@v4.0.2
with:
path: ~/.composer/cache
key: php-composer-cache
- run: composer install
- name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }})
run: |
docker rm -f temp-ps || true
docker volume rm -f ps-volume || true
docker run -d --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }}
docker exec -t temp-ps rm -rf /var/www/html/modules/autoupgrade
docker build -t phpstan:php-7.4 ./tests/phpstan/
docker run --rm \
--volumes-from temp-ps \
-v $PWD:/var/www/html/modules/autoupgrade \
-e _PS_ROOT_DIR_=/var/www/html \
--workdir=/var/www/html/modules/autoupgrade \
phpstan:php-7.4 \
analyse --configuration=/var/www/html/modules/autoupgrade/tests/phpstan/phpstan-${{ matrix.presta-versions }}.neon