-
Notifications
You must be signed in to change notification settings - Fork 66
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
Run campaigns tests after an upgrade of PrestaShop #37
Closed
Closed
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
65fcf69
Add workflow to test autoupgrade
jolelievre cf0c029
Trigger workflow on push
jolelievre 0acf4ca
Add workflow_call
jolelievre d7a727f
Add workflow call
jolelievre f4cc3b8
Add types
jolelievre 87113a6
Ubuntu latest
jolelievre c7eb68e
Fix docker build
jolelievre d2b0238
Fix set output
jolelievre 5f9be17
Fix docker build
jolelievre b9ddcf9
Fix version fetch
jolelievre 8011b99
Fix script path
jolelievre 8813b71
Checkout for the script
jolelievre 3a60ba0
Debug nightly version and docker version
jolelievre 683947f
Debug target branch
jolelievre ee32175
Remove custom container name
jolelievre 2c74b90
DEbug comment
jolelievre c8649e6
Still fixing versions
jolelievre 3e8b5a7
Add inputs
jolelievre 2d2965e
Remove inputs
jolelievre ae08566
Fiw wokflow call inputs
jolelievre 62fc2bd
Final inputs for nightly, add specific container name
jolelievre 942e70b
Fix module upgrade install
jolelievre 59b40a2
Fix composer install for module
jolelievre d4ddf24
Fix composer
jolelievre 32e1ef6
Fix autoupgrade checkout
jolelievre c767f70
Add admin dir
jolelievre 8208cf7
Avoid skipping upgrade
jolelievre 75301d3
Replace UI tests with target branch tests
jolelievre 488a3cd
Optimize checkout for tests and use correct URL in tests
jolelievre d89d0e1
Handle upgrade to branch repository
jolelievre b4d4f47
Test full workflow based on nighly builds
jolelievre 506d5a8
Fix getting source details
jolelievre 08f788f
Double unzip for source archive
jolelievre 3d40e35
Create extraction folder
jolelievre 36b980c
Fix source zip path
jolelievre cb05e67
Source cannot be used with nightly as it has no docker files
jolelievre ffcbeaf
Handle using tags in addition with branches
jolelievre e95b91c
Fix required
jolelievre 9f7bee1
Force test with PHP 7.4 as get_magic_quotes_gpc seems not to exist in…
jolelievre b8d8869
Launch composer install in target folder
jolelievre 8d3e5bb
Build assets as well
jolelievre 63336ea
Build before upgrade
jolelievre 1a089ca
Installer node earlier
jolelievre 000e32f
Conditional fetch on noghtly versions
jolelievre bf5d53a
Prevent error in step name when nightly build is not used
jolelievre 893af41
Add module ref selection
jolelievre 3929a26
Add configuration to disable overrides and custom modules
jolelievre 9427036
Clean comments, prevent fetchin the whole repositories all the time
jolelievre fac72ca
Add concurrency, and option to upload failed upgraded shops
jolelievre da5b962
Remove disabling parameter that seem to prevent upgrade
jolelievre 9528321
Reduce the number of campaigns to run to reduce execution time while …
jolelievre ab436df
Deactivate overrides and modules update
jolelievre 71dac1b
Only disable overrides
jolelievre 79c5f76
Fix json config
jolelievre 84415f1
Renable all campaigns
jolelievre 4784dbe
Disable upload of shop on push workflow
jolelievre 92ecda8
Remove push workflow for first merge of this new workflow
jolelievre 5f2feb9
Change default values
jolelievre f4f29c3
Merge branch 'PrestaShop:main' into test-upgrade
jolelievre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
$nightlyVersion = []; | ||
$nightlyEndpoint = "https://api-nightly.prestashop-project.org/reports"; | ||
|
||
$targetBranch = $argv[1]; | ||
$reports = json_decode(file_get_contents($nightlyEndpoint), true); | ||
$currentDate = ""; | ||
$zipFiles = []; | ||
foreach ($reports as $report) { | ||
if ($report['version'] !== $targetBranch || null === $report['download']) { | ||
continue; | ||
} | ||
|
||
$nightlyVersion = [ | ||
"version" => getVersionFromFilename($report['download']), | ||
"zip" => $report['download'], | ||
"xml" => $report['xml'], | ||
]; | ||
|
||
break; | ||
} | ||
|
||
if (empty($nightlyVersion)) { | ||
throw new \RuntimeException('Could not find version details for branch ' . $targetBranch); | ||
} | ||
|
||
function getVersionFromFilename($filename) { | ||
$matches = []; | ||
preg_match('/^.*prestashop_(.*)\.zip$/', $filename, $matches); | ||
|
||
return $matches[1]; | ||
} | ||
|
||
echo json_encode($nightlyVersion); |
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,82 @@ | ||
name: Testing PrestaShop upgrade | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
upgrade_module_ref: | ||
description: Use a branch or tag for the autoupgrade module | ||
type: choice | ||
required: true | ||
options: | ||
- 'dev' | ||
- 'master' | ||
- '1.7.8.x' | ||
- 'v4.16.0' | ||
- 'v4.15.0' | ||
- 'v4.14.2' | ||
default: 'dev' | ||
source_ref: | ||
type: choice | ||
description: Use a source branch or tag to start the upgrade from | ||
required: true | ||
options: | ||
- '8.1.x' | ||
- '8.0.x' | ||
- '1.7.8.x' | ||
- '8.0.4' | ||
- '1.7.8.9' | ||
default: '8.0.x' | ||
target_ref: | ||
type: choice | ||
description: Use a target branch or tag to upgrade to | ||
required: true | ||
options: | ||
- 'develop' | ||
- '8.1.x' | ||
- '8.0.x' | ||
- '8.0.4' | ||
- '8.1.0' | ||
default: '8.1.x' | ||
use_nightly_build: | ||
type: boolean | ||
description: Use latest nightly matching the target branch, if not the branch is checkout from repository branch HEAD | ||
default: false | ||
target_version: | ||
description: If you do not use the nightly release, you must specify the version of target branch (ex 1.7.8.9, 8.0.4) | ||
type: string | ||
require: false | ||
php_version: | ||
type: choice | ||
description: PHP version | ||
required: true | ||
options: | ||
- '7.3' | ||
- '7.4' | ||
- '8.0' | ||
- '8.1' | ||
- '8.2' | ||
default: '8.1' | ||
node_version: | ||
type: choice | ||
description: Node version | ||
required: true | ||
options: | ||
- '14' | ||
- '16' | ||
default: '14' | ||
upload_shop_on_failure: | ||
description: Upload upgraded shop as an artifact if tests failed | ||
type: boolean | ||
required: false | ||
default: false | ||
|
||
jobs: | ||
manual_test_upgrade: | ||
uses: ./.github/workflows/upgrade_test_workflow_call.yml | ||
with: | ||
source_ref: ${{ github.event.inputs.source_ref }} | ||
target_ref: ${{ github.event.inputs.target_ref }} | ||
use_nightly_build: ${{ github.event.inputs.use_nightly_build }} | ||
target_version: ${{ github.event.inputs.target_version }} | ||
php_version: ${{ github.event.inputs.php_version }} | ||
node_version: ${{ github.event.inputs.node_version }} | ||
upload_shop_on_failure: ${{ github.event.inputs.upload_shop_on_failure }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy paste error i think