-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #535 from PrestaShop/dev
Release 4.15.0
- Loading branch information
Showing
310 changed files
with
4,392 additions
and
3,175 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,71 @@ | ||
name: PHP tests | ||
on: [push, pull_request] | ||
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/[email protected] | ||
|
||
- 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/CoreUpgrader80.php\"" | ||
|
||
- 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/[email protected] | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer global require friendsofphp/php-cs-fixer | ||
composer global require prestashop/php-dev-tools | ||
- name: Run PHP-CS-Fixer | ||
run: php-cs-fixer fix --dry-run --diff --using-cache=no | ||
|
||
php-unit: | ||
strategy: | ||
matrix: | ||
|
@@ -20,22 +85,25 @@ jobs: | |
- 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.6.1.18', '1.7.6.9', 'latest' ] | ||
presta-versions: ['1.6.1.18', '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/[email protected] | ||
|
||
# Add vendor folder in cache to make next builds faster | ||
- name: Cache vendor folder | ||
uses: actions/cache@v1 | ||
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@v1 | ||
with: | ||
|
@@ -45,17 +113,16 @@ jobs: | |
- run: composer install | ||
|
||
- name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }}) | ||
env: | ||
PS_VERSION: ${{ matrix.presta-versions }} | ||
IS_16: ${{ startsWith(matrix.presta-versions, '1.6') }} | ||
run: | | ||
PHPSTAN_FILE="phpstan.neon" && [[ $IS_16 == true ]] && PHPSTAN_FILE="phpstan-PS-16.neon" | ||
echo $PHPSTAN_FILE | ||
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:$PS_VERSION | ||
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_FILE | ||
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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
$config = new PrestaShop\CodingStandards\CsFixer\Config(); | ||
|
||
$config | ||
->setUsingCache(true) | ||
->getFinder() | ||
->in(__DIR__) | ||
->exclude('vendor'); | ||
|
||
return $config; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.