Skip to content

Testing PrestaShop pull requests #480

Testing PrestaShop pull requests

Testing PrestaShop pull requests #480

Workflow file for this run

name: Testing PrestaShop pull requests
on:
workflow_dispatch:
inputs:
pr_number:
description: Pull request Id (leave empty to test branch/version only)
required: false
default: ''
base_branch:
type: choice
description: Base branch to rebase the PR
required: true
options:
- 'develop'
- '8.1.x'
- '8.0.x'
- '1.7.8.x'
default: 'develop'
fast_fail:
type: boolean
description: Fast fail on first error
required: true
default: false
ps_mode_dev:
type: boolean
description: Use developer mode?
required: true
backoffice_layout:
type: choice
description: Backoffice layout
required: true
options:
- 'legacy'
- 'symfony'
default: 'legacy'
rebase_or_merge:
type: choice
required: true
description: Rebase or merge the pull request
options:
- 'rebase'
- 'merge'
default: 'rebase'
php_version:
type: choice
description: PHP version
required: true
options:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
default: '8.1'
jobs:
build-settings-job:
runs-on: ubuntu-latest
name: Prepare build settings
outputs:
php-version: ${{ steps.build-settings-step.outputs.php-version }}
node-version: ${{ steps.build-settings-step.outputs.node-version }}
steps:
# Checkout repository to use custom actions
- uses: actions/checkout@v3
with:
path: custom_actions
- name: Setup PrestaShop build env variables
uses: ./custom_actions/.github/workflows/actions/prepare-build-settings
id: build-settings-step
with:
repository_ref: ${{ inputs.base_branch }}
php_version: ${{ inputs.php_version }}
# Sanity tests are run independently because it's the only campaign that handles the installation itself, since it tests it
sanity-test:
name: Sanity campaign
uses: ./.github/workflows/test-sanity.yml
needs: build-settings-job
with:
pr_number: ${{ inputs.pr_number }}
repository_ref: ${{ inputs.base_branch }}
ps_mode_dev: ${{ inputs.ps_mode_dev }}
rebase_or_merge: ${{ inputs.rebase_or_merge }}
php_version: ${{ needs.build-settings-job.outputs.php-version }}
node_version: ${{ needs.build-settings-job.outputs.node-version }}
backoffice_layout: ${{ inputs.backoffice_layout }}
fast_fail: ${{ inputs.fast_fail }}
# We perform a unique build that is stored as an artifact, only then do we start the campaign that will rely on this build
build-shop:
name: Prebuild shop and export artifacts
uses: ./.github/workflows/build-shop.yml
needs: build-settings-job
with:
pr_number: ${{ inputs.pr_number }}
repository_ref: ${{ inputs.base_branch }}
ps_mode_dev: ${{ inputs.ps_mode_dev }}
rebase_or_merge: ${{ inputs.rebase_or_merge }}
php_version: ${{ needs.build-settings-job.outputs.php-version }}
node_version: ${{ needs.build-settings-job.outputs.node-version }}
backoffice_layout: ${{ inputs.backoffice_layout }}
# These campaigns are run first because they are longer, so we try to optimize the total run However this list must not
# be too long or too many runners will be blocked by these campaigns and the split would be counter-productive, it's a
# delicate balance to maintain The criteria so far was campaign longer than 15min
test-long-campaigns:
name: Run long campaign ${{ matrix.TEST_COMMAND }}
needs: [build-settings-job, build-shop]
uses: ./.github/workflows/test-with-prebuilt-shop.yml
with:
repository_ref: ${{ inputs.base_branch }}
ps_mode_dev: ${{ inputs.ps_mode_dev }}
php_version: ${{ needs.build-settings-job.outputs.php-version }}
node_version: ${{ needs.build-settings-job.outputs.node-version }}
test_command: ${{ matrix.TEST_COMMAND }}
fast_fail: ${{ inputs.fast_fail }}
strategy:
fail-fast: false
matrix:
TEST_COMMAND:
- 'functional:BO:advanced-parameters:07-10'
- 'functional:BO:catalog:03-04'
- 'functional:BO:catalog:07-08'
- 'functional:BO:design'
- 'functional:BO:orders:01-create-orders'
- 'functional:BO:orders:01-view-and-edit-order'
- 'functional:BO:orders:03-05'
- 'functional:BO:shop-parameters:03-04'
- 'functional:BO:shop-parameters:05-07'
- 'functional:BO:shop-parameters:01-02'
- 'functional:FO:classic:08-12'
BASE_BRANCH:
- ${{ inputs.base_branch }}
exclude:
## 1.7.8.x
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:FO:classic:08-12'
## 8.0.x
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:FO:classic:08-12'
test-short-campaigns:
name: Run short campaign ${{ matrix.TEST_COMMAND }}
needs: [build-settings-job, build-shop]
uses: ./.github/workflows/test-with-prebuilt-shop.yml
with:
repository_ref: ${{ inputs.base_branch }}
ps_mode_dev: ${{ inputs.ps_mode_dev }}
php_version: ${{ needs.build-settings-job.outputs.php-version }}
node_version: ${{ needs.build-settings-job.outputs.node-version }}
test_command: ${{ matrix.TEST_COMMAND }}
fast_fail: ${{ inputs.fast_fail }}
strategy:
fail-fast: false
matrix:
TEST_COMMAND:
- 'cldr'
- 'functional:API'
- 'functional:BO:login'
- 'functional:BO:dashboard'
- 'functional:BO:advanced-parameters:01-06'
- 'functional:BO:advanced-parameters:11-12'
- 'functional:BO:catalog:01-02'
- 'functional:BO:catalog:05-06'
- 'functional:BO:customer:01'
- 'functional:BO:customer:02-03'
- 'functional:BO:customer-service'
- 'functional:BO:header'
- 'functional:BO:international:01'
- 'functional:BO:international:02'
- 'functional:BO:international:03-04'
- 'functional:BO:modules'
- 'functional:BO:orders:01:0-1'
- 'functional:BO:orders:02'
- 'functional:BO:payment'
- 'functional:BO:shipping'
- 'functional:FO:01-03'
- 'functional:FO:04-07'
- 'functional:FO:08-12'
- 'functional:FO:classic:01-03'
- 'functional:FO:classic:04-07'
- 'functional:FO:hummingbird:01-03'
- 'functional:productV2'
- 'functional:WS'
- 'modules'
- 'regression'
- 'sanity:productV2'
BASE_BRANCH:
- ${{ inputs.base_branch }}
exclude:
## 1.7.8.x
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'cldr'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:BO:advanced-parameters:11-12'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:BO:dashboard'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:productV2'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:API'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:FO:classic:01-03'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:FO:classic:04-07'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:FO:hummingbird:01-03'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'functional:WS'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'modules'
- BASE_BRANCH: 1.7.8.x
TEST_COMMAND: 'sanity:productV2'
## 8.0.x
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'cldr'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:BO:advanced-parameters:11-12'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:BO:dashboard'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:productV2'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:API'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:FO:classic:01-03'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:FO:classic:04-07'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:FO:hummingbird:01-03'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'functional:WS'
- BASE_BRANCH: 8.0.x
TEST_COMMAND: 'modules'
## 8.1.x
- BASE_BRANCH: 8.1.x
TEST_COMMAND: 'functional:BO:advanced-parameters:11-12'
- BASE_BRANCH: 8.1.x
TEST_COMMAND: 'functional:FO:01-03'
- BASE_BRANCH: 8.1.x
TEST_COMMAND: 'functional:FO:04-07'
- BASE_BRANCH: 8.1.x
TEST_COMMAND: 'functional:FO:08-12'
## develop
- BASE_BRANCH: develop
TEST_COMMAND: 'functional:FO:01-03'
- BASE_BRANCH: develop
TEST_COMMAND: 'functional:FO:04-07'
- BASE_BRANCH: develop
TEST_COMMAND: 'functional:FO:08-12'
- BASE_BRANCH: develop
TEST_COMMAND: 'sanity:productV2'