Skip to content

Commit

Permalink
Merge pull request #535 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release 4.15.0
  • Loading branch information
matks authored Dec 22, 2022
2 parents deca18e + 35275ed commit a2dc8de
Show file tree
Hide file tree
Showing 310 changed files with 4,392 additions and 3,175 deletions.
5 changes: 3 additions & 2 deletions .github/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ runs:
env:
CHANNEL: 'archive'
ARCHIVE_URL: 'https://github.com/PrestaShop/PrestaShop/releases/download/1.7.7.8/prestashop_1.7.7.8.zip'
XML_URL: 'https://api.prestashop.com/xml/md5/1.7.7.8.xml'
VERSION: '1.7.7.8'
FROM: ${{ matrix.from }}
SKIP: ${{ matrix.ps-versions.channel != 'archive' || !startsWith(matrix.from, '1.6') || startsWith(matrix.ps-versions.version, '1.7.7') }}
shell: bash
run: |
[[ "$SKIP" == true ]] || ${{ github.action_path }}action_upgrade.sh
[[ "$SKIP" == true ]] || docker exec prestashop_autoupgrade rm admin-dev/autoupgrade/modulesToUpgrade.list
[[ "$SKIP" == true ]] || docker stop prestashop_autoupgrade
[[ "$SKIP" == true ]] || docker rm prestashop_autoupgrade
[[ "$SKIP" == true ]] || docker run --name prestashop_autoupgrade -p 8001:80 -v autoupgrade_temp-ps:/var/www/html -v "$(pwd):/var/www/html/modules/autoupgrade" --network autoupgrade_default -d prestashop/base:7.2-apache
[[ "$SKIP" == true ]] || bash -c 'while [[ "$(curl -L -s -o /dev/null -w %{http_code} http://localhost:8001/index.php)" == "000" ]]; do sleep 5; done'
- name: Upgrade
env:
CHANNEL: ${{ matrix.ps-versions.channel }}
ARCHIVE_URL: ${{ matrix.ps-versions.file }}
ARCHIVE_URL: ${{ matrix.ps-versions.zip }}
XML_URL: ${{ matrix.ps-versions.xml }}
VERSION: ${{ matrix.ps-versions.version }}
FROM: ${{ matrix.from }}
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion .github/action_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ if [[ $CHANNEL == "archive" ]]; then

docker exec -u www-data prestashop_autoupgrade mkdir admin-dev/autoupgrade/download
docker exec -u www-data prestashop_autoupgrade curl -L $ARCHIVE_URL -o admin-dev/autoupgrade/download/prestashop.zip
echo "{\"channel\":\"archive\",\"archive_prestashop\":\"prestashop.zip\",\"archive_num\":\"${VERSION}\", \"PS_AUTOUP_CHANGE_DEFAULT_THEME\":${UPDATE_THEME}, \"skip_backup\": ${SKIP_BACKUP}}" > config.json
docker exec -u www-data prestashop_autoupgrade curl -L $XML_URL -o admin-dev/autoupgrade/download/prestashop.xml
echo "{\"channel\":\"archive\",\"archive_prestashop\":\"prestashop.zip\",\"archive_num\":\"${VERSION}\", \"archive_xml\":\"prestashop.xml\", \"PS_AUTOUP_CHANGE_DEFAULT_THEME\":${UPDATE_THEME}, \"skip_backup\": ${SKIP_BACKUP}}" > config.json
docker exec -u www-data prestashop_autoupgrade php admin-dev/autoupgrade/cli-updateconfig.php --from=modules/autoupgrade/config.json --dir=admin-dev
fi

docker exec -u www-data prestashop_autoupgrade php modules/autoupgrade/tests/testCliProcess.php admin-dev/autoupgrade/cli-upgrade.php --dir="admin-dev" --action="compareReleases"
docker exec -u www-data prestashop_autoupgrade php modules/autoupgrade/tests/testCliProcess.php admin-dev/autoupgrade/cli-upgrade.php --dir="admin-dev"
3 changes: 2 additions & 1 deletion .github/get_matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"channel" => "archive",
"branch" => $report['version'],
"version" => getVersionFromFilename($report['download']),
"file" => $report['download']
"zip" => $report['download'],
"xml" => $report['xml'],
];
}
}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/e2e_nightly_upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Nightly upgrades with user inferfaces
name: Nightly upgrades with user interfaces

on:
schedule:
- cron: "0 6 * * *" # Every day at 06:00Am
#Disabled for now : dependencies used are hard to maintain, should be fixed
#schedule:
# - cron: "0 6 * * *" # Every day at 06:00Am

env:
reports_directory: ${{ github.workspace }}/json-reports
Expand Down Expand Up @@ -213,7 +214,7 @@ jobs:
name: combined-report-${{ matrix.ps_target_version.branch }}
path: ${{ env.reports_directory }}

- uses: google-github-actions/setup-gcloud@master
- uses: google-github-actions/setup-gcloud@v0
name: Setup Cloud Sdk
with:
project_id: ${{ secrets.GC_PROJECT_ID }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Nightly Upgrades
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
Expand Down Expand Up @@ -82,7 +83,7 @@ jobs:
- name: Format results
run: php ./.github/get_results.php ${{matrix.ps-versions.branch}}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GC_PROJECT_ID }}
service_account_key: ${{ secrets.GC_SERVICE_KEY }}
Expand Down
87 changes: 77 additions & 10 deletions .github/workflows/php.yml
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/checkout@v2.0.0

- 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/checkout@v2.0.0

- 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:
Expand All @@ -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/checkout@v2.0.0

# 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:
Expand All @@ -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
11 changes: 11 additions & 0 deletions .php-cs-fixer.dist.php
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;
36 changes: 0 additions & 36 deletions .php_cs.dist

This file was deleted.

Loading

0 comments on commit a2dc8de

Please sign in to comment.