Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a failsafe require and add first working version of 1.7 in automatic tests #688

Merged
merged 9 commits into from
Apr 22, 2024
27 changes: 26 additions & 1 deletion .github/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,35 @@ description: Test PrestaShop upgrade process
runs:
using: composite
steps:
- name: Get base version
id: get_base_version
shell: bash
run: |
case ${{ matrix.from }} in
1.6* | 1.7.[1-4]*)
echo "BASE_VERSION=7.1-apache" >> "$GITHUB_OUTPUT"
;;
1.7.[5-6]*)
echo "BASE_VERSION=7.2-apache" >> "$GITHUB_OUTPUT"
;;
1.7.7*)
echo "BASE_VERSION=7.3-apache" >> "$GITHUB_OUTPUT"
;;
1.7.8*)
echo "BASE_VERSION=7.4-apache" >> "$GITHUB_OUTPUT"
;;
8.0* | 8.1*)
echo "BASE_VERSION=8.1-apache" >> "$GITHUB_OUTPUT"
;;
*)
echo "BASE_VERSION=7.1-apache" >> "$GITHUB_OUTPUT"
;;
esac

- name: Build docker compose stack
env:
VERSION: ${{ matrix.from }}
BASE_VERSION: ${{ startsWith(matrix.from, '1.6') && '7.1-apache' || startsWith(matrix.from, '8.1') && '8.1-apache' || startsWith(matrix.from, '8.0') && '8.1-apache' || '7.2-apache' }}
BASE_VERSION: ${{ steps.get_base_version.outputs.BASE_VERSION }}
shell: bash
run: |
docker compose up -d
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
upgrade:
strategy:
matrix:
from: ['1.7.6.9', '1.7.6.1', '1.7.7.0', '8.0.0', '8.1.0']
from: ['1.7.0.6', '1.7.6.9', '1.7.6.1', '1.7.7.0', '8.0.0', '8.1.0']
ps-versions:
- channel: minor
- channel: major
Expand Down
7 changes: 4 additions & 3 deletions classes/UpgradeTools/SymfonyAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ public function initKernel()
{
global $kernel;
if (!$kernel instanceof \AppKernel) {
// Only necessary one version before 1.7.3 because he is not classmaped on composer
require_once _PS_ROOT_DIR_ . '/app/AppKernel.php';
$env = (true == _PS_MODE_DEV_) ? 'dev' : 'prod';

if ($this->isAppKernelAbstract()) { // From version 9 the AppKernel becomes an abstract so we need to check if it is one to know which Kernel to use
require_once _PS_ROOT_DIR_ . '/app/AdminKernel.php';
// From version 9 the AppKernel becomes an abstract so we need to check if it is one to know which Kernel to use
if ($this->isAppKernelAbstract()) {
$kernelClass = 'AdminKernel';
} else {
require_once _PS_ROOT_DIR_ . '/app/AppKernel.php';
$kernelClass = 'AppKernel';
}

Expand Down
Loading