From 34c97eb1e06b24a7a74e9302571b9e958a900e62 Mon Sep 17 00:00:00 2001 From: morgan Date: Tue, 7 May 2024 14:29:21 +0200 Subject: [PATCH] wip --- .github/workflows/api-module.yml | 87 ------ .github/workflows/behaviour.yml | 80 ----- .../check_need_autoupgrade_pr_label.yml | 2 +- .github/workflows/cron_docker_build.yml | 28 -- .github/workflows/cron_js_routing.yml | 124 -------- .github/workflows/cron_nightly_build.yml | 95 ------ .../workflows/cron_nightly_tests_1.7.8.x.yml | 19 -- .../workflows/cron_nightly_tests_8.0.x.yml | 19 -- .../workflows/cron_nightly_tests_8.1.x.yml | 19 -- .../workflows/cron_nightly_tests_develop.yml | 19 -- .../workflows/cron_nightly_tests_reports.yml | 30 -- .../workflows/cron_nightly_tests_reusable.yml | 286 ------------------ .github/workflows/cron_php_update_modules.yml | 83 ----- .github/workflows/integration.yml | 87 ------ .github/workflows/js.yml | 36 --- .github/workflows/lint.yml | 140 --------- .github/workflows/php.yml | 137 --------- .github/workflows/pr.yml | 29 -- .github/workflows/sanity.yml | 59 ---- .github/workflows/symfony-console.yml | 111 ------- .github/workflows/ui_tests_code_checks.yml | 134 -------- 21 files changed, 1 insertion(+), 1623 deletions(-) delete mode 100644 .github/workflows/api-module.yml delete mode 100644 .github/workflows/behaviour.yml delete mode 100644 .github/workflows/cron_docker_build.yml delete mode 100644 .github/workflows/cron_js_routing.yml delete mode 100644 .github/workflows/cron_nightly_build.yml delete mode 100644 .github/workflows/cron_nightly_tests_1.7.8.x.yml delete mode 100644 .github/workflows/cron_nightly_tests_8.0.x.yml delete mode 100644 .github/workflows/cron_nightly_tests_8.1.x.yml delete mode 100644 .github/workflows/cron_nightly_tests_develop.yml delete mode 100644 .github/workflows/cron_nightly_tests_reports.yml delete mode 100644 .github/workflows/cron_nightly_tests_reusable.yml delete mode 100644 .github/workflows/cron_php_update_modules.yml delete mode 100644 .github/workflows/integration.yml delete mode 100644 .github/workflows/js.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/php.yml delete mode 100644 .github/workflows/pr.yml delete mode 100644 .github/workflows/sanity.yml delete mode 100644 .github/workflows/symfony-console.yml delete mode 100644 .github/workflows/ui_tests_code_checks.yml diff --git a/.github/workflows/api-module.yml b/.github/workflows/api-module.yml deleted file mode 100644 index 58fb46650929b..0000000000000 --- a/.github/workflows/api-module.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: API Module tests -on: - push: - pull_request: - -permissions: - contents: read # to clone the repos and get release assets (shivammathur/setup-php) -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - integration: - permissions: - contents: read # to clone the repos and get release assets (shivammathur/setup-php) - name: API Module tests - runs-on: ubuntu-latest - strategy: - matrix: - php: [ '8.1', '8.2', '8.3' ] - fail-fast: false - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Setup MySQL - uses: mirromutth/mysql-action@v1.1 - with: - mysql version: '8.0' - mysql database: 'prestashop' - mysql root password: 'password' - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '16' - - - uses: actions/checkout@v4 - - - name: PrestaShop Configuration - run: | - cp .github/workflows/phpunit/parameters.yml app/config/parameters.yml - cp .github/workflows/phpunit/parameters.php app/config/parameters.php - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Node Directory - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node- - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Update phpunit version - if: ${{ startsWith(matrix.php, '8.') }} - run: composer update -w --ignore-platform-reqs --no-interaction phpunit/phpunit - - # Front assets are needed for the theme to be installed and image types to be inserted in DB, admin assets required especially in Symfony layout - # because some built files (like preload.html.twig) are included and cause errors when absent - - name: Build all assets - run: make assets - - - name: Change MySQL authentication method - run: mysql -h127.0.0.1 -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; FLUSH PRIVILEGES;" - - - name: Run integration-tests - run: composer run-script api-module-tests --timeout=0 - env: - SYMFONY_DEPRECATIONS_HELPER: disabled - - - name: Test git versionned files unchanged - if: ${{ !startsWith(matrix.php, '8.') }} # composer.lock changes when updating phpunit version - run: git diff --exit-code diff --git a/.github/workflows/behaviour.yml b/.github/workflows/behaviour.yml deleted file mode 100644 index 2d5a6f79eea3a..0000000000000 --- a/.github/workflows/behaviour.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Behaviour tests -on: - push: - pull_request: - -permissions: - contents: read # to clone the repos and get release assets (shivammathur/setup-php) -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - behaviour: - permissions: - contents: read # to clone the repos and get release assets (shivammathur/setup-php) - name: Behaviour tests - runs-on: ubuntu-latest - strategy: - matrix: - php: [ '8.1', '8.2', '8.3' ] - fail-fast: false - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Setup MySQL - uses: mirromutth/mysql-action@v1.1 - with: - mysql version: '8.0' - mysql database: 'prestashop' - mysql root password: 'password' - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '14' - - - uses: actions/checkout@v4 - - - name: PrestaShop Configuration - run: | - cp .github/workflows/phpunit/parameters.yml app/config/parameters.yml - cp .github/workflows/phpunit/parameters.php app/config/parameters.php - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Node Directory - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node- - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Build theme assets - run: make front-classic - - - name: Change MySQL authentication method - run: mysql -h127.0.0.1 -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; FLUSH PRIVILEGES;" - - - name: Run integration-behaviour-tests - run: composer run-script integration-behaviour-tests --timeout=0 - env: - SYMFONY_DEPRECATIONS_HELPER: disabled - - - name: Test git versionned files unchanged - run: git diff --exit-code diff --git a/.github/workflows/check_need_autoupgrade_pr_label.yml b/.github/workflows/check_need_autoupgrade_pr_label.yml index 9b5f1b80aed52..342f277d28ed0 100644 --- a/.github/workflows/check_need_autoupgrade_pr_label.yml +++ b/.github/workflows/check_need_autoupgrade_pr_label.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ format('github.event.pull_request.{0}.ref', matrix.branch) }} + ref: ${{ github.event.pull_request.{{ matrix.branch }}.ref }} - name: Docker build run: docker compose build prestashop-git diff --git a/.github/workflows/cron_docker_build.yml b/.github/workflows/cron_docker_build.yml deleted file mode 100644 index 4641ff261099d..0000000000000 --- a/.github/workflows/cron_docker_build.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This tests the build for development -name: Cron docker build - -on: - schedule: - - cron: '0 1 * * *' - -jobs: - docker-build: - name: Docker build - - runs-on: ubuntu-latest - - strategy: - matrix: - version: - - 8.1 - base: - - apache - - fpm - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Running latest prestashop with docker - run: docker compose build --build-arg VERSION=${{ matrix.version }}-${{ matrix.base }} diff --git a/.github/workflows/cron_js_routing.yml b/.github/workflows/cron_js_routing.yml deleted file mode 100644 index c114fd610d9ec..0000000000000 --- a/.github/workflows/cron_js_routing.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: Cron Update JS Routing -on: - schedule: - - cron: '0 23 * * *' - workflow_dispatch: - -permissions: { } -jobs: - js-routing-dump: - permissions: - contents: write # to create branch (peter-evans/create-pull-request) - pull-requests: write # to create a PR (peter-evans/create-pull-request) - - runs-on: ubuntu-latest - name: Update JS Routing - strategy: - fail-fast: false - matrix: - BRANCH: - - develop - - 8.1.x - - 8.0.x - include: - - BRANCH: develop - node: 16 - - BRANCH: 8.1.x - node: 16 - - BRANCH: 8.0.x - node: 16 - - env: - PHP_VERSION: '7.4' - NODE_VERSION: ${{ matrix.node }} - GH_BRANCH: ${{ matrix.BRANCH }} - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ env.PHP_VERSION }} - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup MySQL - uses: mirromutth/mysql-action@v1.1 - with: - mysql version: '5.7' - mysql database: 'prestashop' - mysql root password: 'password' - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ env.GH_BRANCH }} - - - name: PrestaShop Configuration - run: cp .github/workflows/phpunit/parameters.yml app/config/parameters.yml - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Node Directory - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: composer install --prefer-dist - - - name: Build assets - run: make assets - - - name: Install PrestaShop - # yamllint disable-line rule:line-length - run: php install-dev/index_cli.php --language=en --country=fr --domain=localhost --db_server=127.0.0.1 --db_password=password --db_name=prestashop --db_create=1 --name=prestashop.unit.test --email=demo@prestashop.com --password=prestashop_demo - - - name: Dump JS Routing file - # yamllint disable-line rule:line-length - run: php bin/console fos:js-routing:dump --format=json --target=admin-dev/themes/new-theme/js/fos_js_routes.json - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: cron-js-routing - add-paths: | - admin-dev/themes/new-theme/js/fos_js_routes.json - commit-message: Updated JS Routing file - committer: PrestonBot - author: prestonBot - title: 'Updated JS Routing file' - body: | - | Questions | Answers - | ----------------- | ------------------------------------------------------- - | Branch? | ${{ env.GH_BRANCH }} - | Description? | Updated JS Routing file - | Type? | improvement - | Category? | CO - | BC breaks? | no - | Deprecations? | no - | Fixed ticket? | N/A - | How to test? | N/A - | Possible impacts? | N/A - base: ${{ env.GH_BRANCH }} - delete-branch: true diff --git a/.github/workflows/cron_nightly_build.yml b/.github/workflows/cron_nightly_build.yml deleted file mode 100644 index b3294d9145d49..0000000000000 --- a/.github/workflows/cron_nightly_build.yml +++ /dev/null @@ -1,95 +0,0 @@ -# This workflow aim to create nightly builds on active branches -name: Nightly Build - -on: - schedule: - - cron: '0 1 * * *' - workflow_dispatch: - -permissions: - contents: read - -jobs: - nightly-build: - name: Nightly Build - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - BRANCH: - - develop - - 8.1.x - - 8.0.x - - 1.7.8.x - include: - - BRANCH: develop - node: 16 - - BRANCH: 8.1.x - node: 16 - - BRANCH: 8.0.x - node: 14 - - BRANCH: 1.7.8.x - node: 14 - - env: - PHP_VERSION: '7.4' - NODE_VERSION: ${{ matrix.node }} - RELEASE_DIR: '/tmp/ps-release' - GH_BRANCH: ${{ matrix.BRANCH }} - GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }} - GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ env.GH_BRANCH }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ env.PHP_VERSION }} - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Create Release directory - run: mkdir -p ${{ env.RELEASE_DIR }} - - - name: Create build - run: php tools/build/CreateRelease.php --destination-dir=${{ env.RELEASE_DIR }} - - - name: Rename build - run: today=`date +%Y-%m-%d`; for i in *; do mv $i $today-$GH_BRANCH-$i; done - working-directory: ${{ env.RELEASE_DIR }} - - - name: Create nightly.zip for develop - if: env.GH_BRANCH == 'develop' - run: | - today=`date +%Y-%m-%d` - cp $today-$GH_BRANCH*.zip nightly.zip - working-directory: ${{ env.RELEASE_DIR }} - - - name: Auth Cloud Sdk - uses: google-github-actions/auth@v1 - with: - credentials_json: ${{ env.GC_SERVICE_KEY }} - project_id: ${{ env.GC_PROJECT_ID }} - - - name: Setup Cloud Sdk - uses: google-github-actions/setup-gcloud@v1 - - - name: Delete last Nightly zip from develop - if: env.GH_BRANCH == 'develop' - run: gsutil rm -rf gs://prestashop-core-nightly/nightly.zip - - - name: Upload to Google Cloud Storage (GCS) - if: always() - run: gsutil cp -r "${{ env.RELEASE_DIR }}/**" gs://prestashop-core-nightly diff --git a/.github/workflows/cron_nightly_tests_1.7.8.x.yml b/.github/workflows/cron_nightly_tests_1.7.8.x.yml deleted file mode 100644 index c5e4c0bc114ab..0000000000000 --- a/.github/workflows/cron_nightly_tests_1.7.8.x.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This workflow aim to run all UI tests on active branches -# and upload the report on Google cloud platform storage -name: Nightly tests and report - 1.7.8.x - -on: - workflow_run: - workflows: [ 'Nightly Build' ] - types: - - requested - -jobs: - test_1_7_8_x: - uses: ./.github/workflows/cron_nightly_tests_reusable.yml - with: - BRANCH: 1.7.8.x - PHP_VERSION: '7.4' - secrets: - GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }} - GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }} diff --git a/.github/workflows/cron_nightly_tests_8.0.x.yml b/.github/workflows/cron_nightly_tests_8.0.x.yml deleted file mode 100644 index 34eb80300d42c..0000000000000 --- a/.github/workflows/cron_nightly_tests_8.0.x.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This workflow aim to run all UI tests on active branches -# and upload the report on Google cloud platform storage -name: Nightly tests and report - 8.0.x - -on: - workflow_run: - workflows: [ 'Nightly Build' ] - types: - - requested - -jobs: - test_8_0_x: - uses: ./.github/workflows/cron_nightly_tests_reusable.yml - with: - BRANCH: 8.0.x - PHP_VERSION: '8.1' - secrets: - GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }} - GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }} diff --git a/.github/workflows/cron_nightly_tests_8.1.x.yml b/.github/workflows/cron_nightly_tests_8.1.x.yml deleted file mode 100644 index 418019a044b30..0000000000000 --- a/.github/workflows/cron_nightly_tests_8.1.x.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This workflow aim to run all UI tests on active branches -# and upload the report on Google cloud platform storage -name: Nightly tests and report - 8.1.x - -on: - workflow_run: - workflows: [ 'Nightly Build' ] - types: - - requested - -jobs: - test_8_1_x: - uses: ./.github/workflows/cron_nightly_tests_reusable.yml - with: - BRANCH: 8.1.x - PHP_VERSION: '8.1' - secrets: - GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }} - GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }} diff --git a/.github/workflows/cron_nightly_tests_develop.yml b/.github/workflows/cron_nightly_tests_develop.yml deleted file mode 100644 index 61f445f305563..0000000000000 --- a/.github/workflows/cron_nightly_tests_develop.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This workflow aim to run all UI tests on active branches -# and upload the report on Google cloud platform storage -name: Nightly tests and report - develop - -on: - workflow_run: - workflows: [ 'Nightly Build' ] - types: - - requested - -jobs: - test_develop: - uses: ./.github/workflows/cron_nightly_tests_reusable.yml - with: - BRANCH: develop - PHP_VERSION: '8.2' - secrets: - GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }} - GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }} diff --git a/.github/workflows/cron_nightly_tests_reports.yml b/.github/workflows/cron_nightly_tests_reports.yml deleted file mode 100644 index 75427fa0f7e42..0000000000000 --- a/.github/workflows/cron_nightly_tests_reports.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This workflow aim to run all UI tests on active branches -# and upload the report on Google cloud platform storage -name: Nightly tests (Report) - -on: - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - -jobs: - # Add pushed reports to GCP on nightly - push-nightly-reports: - name: Push reports to nightly.prestashop-project.org - runs-on: ubuntu-latest - - strategy: - fail-fast: false - max-parallel: 1 - matrix: - BRANCH: - - 1.7.8.x - - 8.0.x - - 8.1.x - - develop - - steps: - - name: Push reports - run: | - REPORT_NAME="$(date +%Y-%m-%d)-${{ matrix.branch }}" - curl -v "https://api-nightly.prestashop-project.org/hook/reports/import?token=${{ secrets.NIGHTLY_TOKEN }}&filename=${REPORT_NAME}.json" diff --git a/.github/workflows/cron_nightly_tests_reusable.yml b/.github/workflows/cron_nightly_tests_reusable.yml deleted file mode 100644 index 1000896b5903d..0000000000000 --- a/.github/workflows/cron_nightly_tests_reusable.yml +++ /dev/null @@ -1,286 +0,0 @@ -# This workflow aim to run all UI tests on active branches -# and upload the report on Google cloud platform storage -name: Nightly tests (Run & Upload) - -on: - workflow_call: - inputs: - BRANCH: - required: true - type: string - PHP_VERSION: - required: true - type: string - NODE_VERSION: - description: 'Node Version' - required: false - type: string - default: '14' - TESTS_DIR: - description: 'Where UI tests are' - required: false - type: string - default: 'tests/UI' - secrets: - ## GCP Project ID - GC_PROJECT_ID: - required: true - ## GCP Service Key - GC_SERVICE_KEY: - required: true - -permissions: - contents: read - -jobs: - - # First job: Run tests in parallel - test: - name: Nightly tests - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - BRANCH: - - ${{ inputs.BRANCH }} - CAMPAIGN: - - 'cldr' - - 'sanity' - - 'sanity:productV2' - - 'functional:BO:login' - - 'functional:BO:dashboard' - - 'functional:BO:orders:01:0-1' - - 'functional:BO:orders:01-create-orders' - - 'functional:BO:orders:01-view-and-edit-order' - - 'functional:BO:orders:02' - - 'functional:BO:orders:03-05' - - 'functional:BO:catalog:01-02' - - 'functional:BO:catalog:03-04' - - 'functional:BO:catalog:05-06' - - 'functional:BO:catalog:07-08' - - 'functional:BO:customer:01' - - 'functional:BO:customer:02-03' - - 'functional:BO:customer-service' - - 'functional:BO:modules' - - 'functional:BO:design' - - 'functional:BO:shipping' - - 'functional:BO:payment' - - 'functional:BO:international:01' - - 'functional:BO:international:02' - - 'functional:BO:international:03-04' - - 'functional:BO:shop-parameters:01-02' - - 'functional:BO:shop-parameters:03-04' - - 'functional:BO:shop-parameters:05-07' - - 'functional:BO:advanced-parameters:01-06' - - 'functional:BO:advanced-parameters:07-10' - - 'functional:BO:advanced-parameters:11-12' - - 'functional:BO:header' - - 'functional:FO:01-03' - - 'functional:FO:04-07' - - 'functional:FO:08-12' - - 'functional:FO:classic:01-03' - - 'functional:FO:classic:04-07' - - 'functional:FO:classic:08-12' - - 'functional:FO:hummingbird:01-03' - - 'functional:FO:hummingbird:04-07' - - 'functional:FO:hummingbird:08-12' - - 'functional:productV2' - - 'functional:API' - - 'functional:WS' - - 'modules' - - 'regression' - exclude: - ## 1.7.8.x - - BRANCH: 1.7.8.x - CAMPAIGN: 'cldr' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:BO:advanced-parameters:11-12' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:BO:dashboard' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:productV2' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:API' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:FO:classic:01-03' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:FO:classic:04-07' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:FO:classic:08-12' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:FO:hummingbird:01-03' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:FO:hummingbird:04-07' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:FO:hummingbird:08-12' - - BRANCH: 1.7.8.x - CAMPAIGN: 'functional:WS' - - BRANCH: 1.7.8.x - CAMPAIGN: 'modules' - - BRANCH: 1.7.8.x - CAMPAIGN: 'sanity:productV2' - ## 8.0.x - - BRANCH: 8.0.x - CAMPAIGN: 'cldr' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:BO:advanced-parameters:11-12' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:BO:dashboard' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:productV2' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:API' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:FO:classic:01-03' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:FO:classic:04-07' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:FO:classic:08-12' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:FO:hummingbird:01-03' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:FO:hummingbird:04-07' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:FO:hummingbird:08-12' - - BRANCH: 8.0.x - CAMPAIGN: 'functional:WS' - - BRANCH: 8.0.x - CAMPAIGN: 'modules' - ## 8.1.x - - BRANCH: 8.1.x - CAMPAIGN: 'functional:BO:advanced-parameters:11-12' - - BRANCH: 8.1.x - CAMPAIGN: 'functional:FO:01-03' - - BRANCH: 8.1.x - CAMPAIGN: 'functional:FO:04-07' - - BRANCH: 8.1.x - CAMPAIGN: 'functional:FO:08-12' - - BRANCH: 8.1.x - CAMPAIGN: 'functional:FO:hummingbird:04-07' - - BRANCH: 8.1.x - CAMPAIGN: 'functional:FO:hummingbird:08-12' - ## develop - - BRANCH: develop - CAMPAIGN: 'functional:FO:01-03' - - BRANCH: develop - CAMPAIGN: 'functional:FO:04-07' - - BRANCH: develop - CAMPAIGN: 'functional:FO:08-12' - - BRANCH: develop - CAMPAIGN: 'sanity:productV2' - - BRANCH: develop - CAMPAIGN: 'functional:productV2' - - env: - GH_BRANCH: ${{ matrix.BRANCH }} # Branch to test - REPORTS_DIR: 'reports_${{ matrix.BRANCH }}' # Where to move test's reports - TEST_CAMPAIGN: ${{ matrix.CAMPAIGN }} # Command to execute from the matrix - INSTALL_AUTO: ${{ (matrix.CAMPAIGN == 'sanity') && 'false' || 'true' }} - ENABLE_SSL: ${{ ((matrix.BRANCH == '8.0.x') || (matrix.BRANCH == '1.7.8.x')) && 'false' || 'true' }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ env.GH_BRANCH }} - - - name: Setup Environment - timeout-minutes: 15 - uses: ./.github/actions/setup-env - with: - PHP_VERSION: ${{ inputs.PHP_VERSION }} - ENABLE_SSL: ${{ env.ENABLE_SSL }} - INSTALL_AUTO: ${{ env.INSTALL_AUTO }} - CP_API_CONFIG: ${{ (env.GH_BRANCH == '8.1.x') && 'true' || 'false' }} - - # Keycloak is only needed for API campaign - - name: Setup Keycloak - uses: ./.github/actions/setup-keycloak - if: ${{ env.GH_BRANCH == 'develop' && env.TEST_CAMPAIGN == 'functional:API' }} - - - name: Run Tests - continue-on-error: true - uses: ./.github/actions/ui-test - with: - NODE_VERSION: ${{ inputs.NODE_VERSION }} - TEST_CAMPAIGN: ${{ env.TEST_CAMPAIGN }} - TESTS_DIR: ${{ inputs.TESTS_DIR }} - - # Rename and upload report as artifact - - name: Rename file reports - working-directory: ${{ inputs.TESTS_DIR }} - env: - REPORTS_DIR_PATH: ${{ github.workspace }}/${{ env.REPORTS_DIR }} - run: | - mkdir -p ${{ env.REPORTS_DIR_PATH }} - FILENAME="$( echo -e '${{ env.TEST_CAMPAIGN }}' | tr ':' '-' )" - mv ./mochawesome-report/mochawesome.json ${{ env.REPORTS_DIR_PATH }}/${FILENAME}.json - - - uses: actions/upload-artifact@v3 - name: Upload report - with: - name: reports_${{ env.GH_BRANCH }} - path: ${{ env.REPORTS_DIR }} - - # Second job: Merge Mochawesome reports and upload them on GCP - ## Always executed even if tests are in error - merge-upload-reports: - name: Combine all reports and upload them - if: ${{ always() }} - needs: - - test - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - BRANCH: - - ${{ inputs.BRANCH }} - - env: - GH_BRANCH: ${{ matrix.branch }} # Branch to test - REPORTS_DIR: 'reports_${{ matrix.BRANCH }}' # Where to move test's reports - COMBINED_REPORT_DIR: 'combined_reports' # Where to store the combined report - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ env.GH_BRANCH }} - - - uses: actions/download-artifact@v3 - name: Download reports - with: - name: reports_${{ env.GH_BRANCH }} - path: ${{ env.REPORTS_DIR }} - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ inputs.NODE_VERSION }} - - - name: Install dependencies - working-directory: ${{ inputs.TESTS_DIR }} - run: npm ci - - - name: Combine reports - working-directory: ${{ inputs.TESTS_DIR }} - env: - REPORTS_DIR_PATH: ${{ github.workspace }}/${{ env.REPORTS_DIR }} - COMBINED_REPORT_DIR_PATH: ${{ github.workspace }}/${{ env.COMBINED_REPORT_DIR }} - run: | - mkdir -p ${{ env.COMBINED_REPORT_DIR_PATH }} - REPORT_NAME="$(date +%Y-%m-%d)-${{ env.GH_BRANCH }}" - npx mochawesome-merge "${{ env.REPORTS_DIR_PATH }}/*.json" -o "${{ env.COMBINED_REPORT_DIR_PATH }}/${REPORT_NAME}.json" - - - name: Auth Cloud Sdk - uses: google-github-actions/auth@v1 - with: - credentials_json: ${{ secrets.GC_SERVICE_KEY }} - project_id: ${{ secrets.GC_PROJECT_ID }} - - - name: Setup Cloud Sdk - uses: google-github-actions/setup-gcloud@v1 - - - name: Upload to Google Cloud Storage (GCS) - run: gsutil cp -r "${{ env.COMBINED_REPORT_DIR }}/**" gs://prestashop-core-nightly/reports diff --git a/.github/workflows/cron_php_update_modules.yml b/.github/workflows/cron_php_update_modules.yml deleted file mode 100644 index 198220ee08762..0000000000000 --- a/.github/workflows/cron_php_update_modules.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Cron Update PHP Modules -on: - schedule: - - cron: '0 23 * * *' - workflow_dispatch: - -permissions: - contents: read - -jobs: - update-composer-modules: - permissions: - contents: write # for peter-evans/create-pull-request to create branch - pull-requests: write # for peter-evans/create-pull-request to create a PR - runs-on: ubuntu-latest - name: Update PHP Modules - strategy: - fail-fast: false - matrix: - BRANCH: - - develop - - 8.1.x - env: - GH_BRANCH: ${{ matrix.BRANCH }} - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 16 - if: env.GH_BRANCH == 'develop' - - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ env.GH_BRANCH }} - - - name: Install Composer dependencies - run: | - composer self-update --stable - composer install --prefer-dist - - - name: Install NPM dependencies - working-directory: ./tests/UI - run: npm ci - if: env.GH_BRANCH == 'develop' - - - name: Execute script for updating modules - run: php .github/workflows/cron_update_modules/script.php ${{ env.GH_BRANCH }} - - - name: Execute script for updating modules - working-directory: ./tests/UI - run: npm run check:data:modules - if: env.GH_BRANCH == 'develop' - - - name: Update PrestaShop packages - id: updated-packages - run: | - FILE_CONTENT=$(cat cron_php_update_modules.txt) - echo PR_BODY=$FILE_CONTENT >> $GITHUB_OUTPUT - rm cron_php_update_modules.txt - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - if: ${{steps.updated-packages.outputs.PR_BODY}} != '' - with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: cron-php-update-modules-${{ env.GH_BRANCH }} - commit-message: Updated PrestaShop Packages - committer: PrestonBot - author: prestonBot - title: 'Updated PrestaShop Packages' - body: ${{steps.updated-packages.outputs.PR_BODY}} - base: ${{ env.GH_BRANCH }} - delete-branch: true diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 7d2d4121f3e5a..0000000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Integration tests -on: - push: - pull_request: - -permissions: - contents: read # to clone the repos and get release assets (shivammathur/setup-php) -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - integration: - permissions: - contents: read # to clone the repos and get release assets (shivammathur/setup-php) - name: Integration tests - runs-on: ubuntu-latest - strategy: - matrix: - php: [ '8.1', '8.2', '8.3' ] - fail-fast: false - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Setup MySQL - uses: mirromutth/mysql-action@v1.1 - with: - mysql version: '8.0' - mysql database: 'prestashop' - mysql root password: 'password' - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '16' - - - uses: actions/checkout@v4 - - - name: PrestaShop Configuration - run: | - cp .github/workflows/phpunit/parameters.yml app/config/parameters.yml - cp .github/workflows/phpunit/parameters.php app/config/parameters.php - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Node Directory - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node- - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Update phpunit version - if: ${{ startsWith(matrix.php, '8.') }} - run: composer update -w --ignore-platform-reqs --no-interaction phpunit/phpunit - - # Front assets are needed for the theme to be installed and image types to be inserted in DB, admin assets required especially in Symfony layout - # because some built files (like preload.html.twig) are included and cause errors when absent - - name: Build all assets - run: make assets - - - name: Change MySQL authentication method - run: mysql -h127.0.0.1 -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; FLUSH PRIVILEGES;" - - - name: Run integration-tests - run: composer run-script integration-tests --timeout=0 - env: - SYMFONY_DEPRECATIONS_HELPER: disabled - - - name: Test git versionned files unchanged - if: ${{ !startsWith(matrix.php, '8.') }} # composer.lock changes when updating phpunit version - run: git diff --exit-code diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml deleted file mode 100644 index b560bf0b7e6ce..0000000000000 --- a/.github/workflows/js.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Js -on: - push: - pull_request: - -permissions: - contents: read -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - js-unit-tests: - runs-on: ubuntu-latest - name: Run unit tests - strategy: - matrix: - js: [ '16' ] - steps: - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.js }} - - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache Node Directory - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node- - - - name: Run tests - run: npm ci && npm run test - working-directory: ./admin-dev/themes/new-theme diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index e5758370bc27d..0000000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: Lint -on: - push: - pull_request: - -permissions: - contents: read -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - stylelint: - name: SCSS Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '16.x' - - - name: BackOffice Theme `new-theme` - run: cd ./admin-dev/themes/new-theme && npm ci && npm run scss-lint - - - name: BackOffice Theme `default` - run: cd ./admin-dev/themes/default && npm ci && npm run scss-lint - - eslint: - name: ESLint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '16.x' - - - name: Validate npm config - run: >- - (cd admin-dev/themes/default && npm ci) - && (cd admin-dev/themes/new-theme && npm ci) - && (cd themes && npm ci) - - - name: BackOffice Theme `default` - run: cd ./admin-dev/themes/default && npm ci && npm run lint - - - name: BackOffice Theme `new-theme` - run: cd ./admin-dev/themes/new-theme && npm ci && npm run lint - - yamllint_sf: - name: YAML Lint (Symfony Check) - runs-on: ubuntu-latest - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Run Lint Yaml on `app` - run: php bin/console lint:yaml app --parse-tags - - - name: Run Lint Yaml on `src` tags are allowed - run: php bin/console lint:yaml src --parse-tags - - - name: Run Lint Yaml on `.t9n.yml` - run: php bin/console lint:yaml .t9n.yml - - yamllint: - name: YAML Lint (YamlLint Check) - runs-on: ubuntu-latest - steps: - - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install YAMLLint - run: | - pip install --user yamllint - - uses: actions/checkout@v4 - - - name: yamllint on `.github` - run: yamllint -c .github/workflows/yamllint/.yamllint.yml .github - - - name: yamllint on `app` - run: yamllint -c .github/workflows/yamllint/.yamllint.yml app - - - name: yamllint on `src` - run: yamllint -c .github/workflows/yamllint/.yamllint.yml src - - - name: yamllint on `.t9n.yml` - run: yamllint -c .github/workflows/yamllint/.yamllint.yml .t9n.yml - - twiglint: - name: Twig Lint - runs-on: ubuntu-latest - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Run Lint Twig - run: php bin/console lint:twig src/PrestaShopBundle/Resources/views/ diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index d92a5a42d7c5b..0000000000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: PHP -on: - push: - pull_request: - -permissions: - contents: read -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - php-cs-fixer: - permissions: - contents: read # for actions/checkout to fetch code - name: PHP CS Fixer - runs-on: ubuntu-latest - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Validate composer config - run: composer validate --strict - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Run PHPCSFixer - run: ./vendor/bin/php-cs-fixer fix --dry-run --diff - - - name: Run ergebnis/composer-normalize - run: composer normalize --dry-run --no-check-lock - phpstan: - permissions: - contents: read # for actions/checkout to fetch code - name: PHP Static Analysis - runs-on: ubuntu-latest - strategy: - matrix: - php: [ '8.1', '8.2', '8.3' ] - fail-fast: false - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' # will be overriden by platform.php in composer.json see https://phpstan.org/config-reference#phpversion - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml - coverage: none # disable coverage to disable xdebug in the action. - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/checkout@v4 - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer Install - run: | - composer install --ansi --prefer-dist --no-interaction --no-progress - rm composer.lock - composer config platform.php ${{ matrix.php }} - - - name: Run phpstan - run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist - phpunit: - permissions: - contents: read # for actions/checkout to fetch code - name: PHPUnit - runs-on: ubuntu-latest - strategy: - matrix: - php: [ '8.1', '8.2', '8.3' ] - fail-fast: false - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/checkout@v4 - - - name: PrestaShop Configuration - run: cp .github/workflows/phpunit/parameters.yml app/config/parameters.yml - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Update phpunit version - if: ${{ startsWith(matrix.php, '8.') }} - run: composer update -w --ignore-platform-reqs --no-interaction phpunit/phpunit - - - name: Run phpunit - run: ./vendor/phpunit/phpunit/phpunit -c tests/Unit/phpunit.xml - env: - SYMFONY_DEPRECATIONS_HELPER: disabled - - - name: Test git versionned files unchanged - if: ${{ !startsWith(matrix.php, '8.') }} # composer.lock changes when updating phpunit version - run: git diff --exit-code diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 23a74cc8fbe51..0000000000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Pull Request Validator -on: pull_request -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - message-check: - name: Block Merge Commits - - runs-on: ubuntu-latest - - steps: - - name: Check is merge PR - id: check-is-merge - run: | - description=$( - cat <<"EOF" - ${{ toJSON(github.event.pull_request.body) }} - EOF - ) - if [[ $description =~ \|?[[:space:]]*Category\?[[:space:]]*\|[[:space:]]*ME([[:space:]]|(\\[rn]))+ ]]; then - echo "isMerge=true" >> $GITHUB_OUTPUT - fi - - - name: Block Merge Commits - if: steps.check-is-merge.outputs.isMerge != 'true' - uses: Morishiri/block-merge-commits-action@v1.0.1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml deleted file mode 100644 index 3545a169bc716..0000000000000 --- a/.github/workflows/sanity.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: UI tests - -on: [ push, pull_request ] - -permissions: - contents: read # to fetch code (actions/checkout) - -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - TEST_CAMPAIGN: 'sanity:fast-fail' - -jobs: - sanity: - permissions: - contents: read # to fetch code (actions/checkout) - runs-on: ubuntu-latest - name: Sanity - strategy: - matrix: - php: [ '8.1', '8.2', '8.3' ] - browser: [ 'chromium', 'firefox', 'webkit' ] - fail-fast: false - - steps: - - uses: actions/checkout@v4 - - - name: Setup Environment - timeout-minutes: 15 - uses: ./.github/actions/setup-env - with: - PHP_VERSION: ${{ matrix.php }} - ENABLE_SSL: 'true' - INSTALL_AUTO: 'false' - - - name: Run Tests - uses: ./.github/actions/ui-test - with: - TEST_CAMPAIGN: ${{ env.TEST_CAMPAIGN }} - BROWSER: ${{ matrix.browser }} - - - name: Export docker logs - if: failure() - run: | - mkdir -p ./var/docker-logs - docker logs prestashop-mysql-1 > ./var/docker-logs/mysql.log - docker logs prestashop-prestashop-git-1 > ./var/docker-logs/prestashop.log - - - name: Upload Screenshots and logs - uses: actions/upload-artifact@v3 - if: failure() - with: - name: sanity-${{ matrix.php }} - path: | - ./tests/UI/screenshots/ - ./var/logs - ./var/docker-logs diff --git a/.github/workflows/symfony-console.yml b/.github/workflows/symfony-console.yml deleted file mode 100644 index be1c64e51c3a2..0000000000000 --- a/.github/workflows/symfony-console.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Symfony Console -on: - push: - pull_request: - -permissions: - contents: read -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - symfony-console: - strategy: - matrix: - app-id: [ admin, admin-api, front ] - fail-fast: false - permissions: - contents: read # for actions/checkout to fetch code - name: Symfony Console - runs-on: ubuntu-latest - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache Composer Directory - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Composer Install - run: composer install --ansi --prefer-dist --no-interaction --no-progress - - - name: Check bin/console can run without shop install and cache clear without app ID (only for admin job since it is the default value) - if: matrix.app-id == 'admin' - run: | - ./bin/console - ./bin/console cache:clear --env=dev - ./bin/console cache:clear --env=prod - ./bin/console cache:clear --env=dev --no-warmup - ./bin/console cache:clear --env=prod --no-warmup - - - name: Check bin/console can run without shop install and cache clear for application ${{ matrix.app-id }} - run: | - ./bin/console --app-id=${{ matrix.app-id }} - ./bin/console cache:clear --env=dev --app-id=${{ matrix.app-id }} - ./bin/console cache:clear --env=prod --app-id=${{ matrix.app-id }} - ./bin/console cache:clear --env=dev --no-warmup --app-id=${{ matrix.app-id }} - ./bin/console cache:clear --env=prod --no-warmup --app-id=${{ matrix.app-id }} - - - name: Check app listeners for OAuth API - if: matrix.app-id == 'admin-api' - run: | - apiListeners=$(./bin/console debug:event-dispatcher kernel.request --app-id=admin-api | grep 'PrestaShopBundle\\EventListener\\API' | wc -l) - adminListeners=$(./bin/console debug:event-dispatcher kernel.request --app-id=admin-api | grep 'PrestaShopBundle\\EventListener\\Admin' | wc -l) - echo $apiListeners API listeners detected - echo $adminListeners Admin listeners detected - if [ $adminListeners -ne 0 ]; then - echo No admin listeners should be present - exit 1 - fi - if [ $apiListeners -eq 0 ]; then - echo No API listeners detected - exit 1 - fi - - - name: Check app listeners for Admin - if: matrix.app-id == 'admin' - run: | - apiListeners=$(./bin/console debug:event-dispatcher kernel.request --app-id=admin | grep 'PrestaShopBundle\\EventListener\\API' | wc -l) - adminListeners=$(./bin/console debug:event-dispatcher kernel.request --app-id=admin | grep 'PrestaShopBundle\\EventListener\\Admin' | wc -l) - echo $apiListeners API listeners detected - echo $adminListeners Admin listeners detected - if [ $adminListeners -eq 0 ]; then - echo No admin listeners detected - exit 1 - fi - if [ $apiListeners -ne 0 ]; then - echo No API listeners should be present - exit 1 - fi - - # Now install the shop - - name: Setup Environment - timeout-minutes: 15 - uses: ./.github/actions/setup-env - with: - PHP_VERSION: 8.1 - ENABLE_SSL: 'true' - INSTALL_AUTO: 'false' - - # Retest the console after shop install - - name: Check bin/console and cache:clear can run after shop install - run: | - docker ps - docker exec prestashop-prestashop-git-1 php ./bin/console --app-id=${{ matrix.app-id }} - docker exec prestashop-prestashop-git-1 php -d memory_limit=-1 ./bin/console cache:clear --env=dev --app-id=${{ matrix.app-id }} - docker exec prestashop-prestashop-git-1 php -d memory_limit=-1 ./bin/console cache:clear --env=prod --app-id=${{ matrix.app-id }} - docker exec prestashop-prestashop-git-1 php ./bin/console cache:clear --env=dev --no-warmup --app-id=${{ matrix.app-id }} - docker exec prestashop-prestashop-git-1 php ./bin/console cache:clear --env=prod --no-warmup --app-id=${{ matrix.app-id }} diff --git a/.github/workflows/ui_tests_code_checks.yml b/.github/workflows/ui_tests_code_checks.yml deleted file mode 100644 index 418bfac257034..0000000000000 --- a/.github/workflows/ui_tests_code_checks.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: UI tests code checks - -on: - push: - paths: - - 'tests/UI/**' - - '.github/workflows/ui_tests_code_checks.yml' - pull_request: - paths: - - 'tests/UI/**' - - '.github/workflows/ui_tests_code_checks.yml' - -defaults: - run: - working-directory: ./tests/UI/ - -env: - NODE_VERSION: '16' - -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - - ESLint: - runs-on: ubuntu-latest - name: ESLint - - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright/ - key: ${{ runner.os }}-browsers - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install dependencies in UI tests directory - run: npm ci - - - name: Check eslint errors - run: npm run lint - - tscheck: - runs-on: ubuntu-latest - name: TypeScript Check - - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright/ - key: ${{ runner.os }}-browsers - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install dependencies in UI tests directory - run: npm ci - - - name: Check TypeScript errors - run: npm run check:typescript - - Steps-identifiers: - runs-on: ubuntu-latest - name: Checking Steps identifiers - - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright/ - key: ${{ runner.os }}-browsers - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install dependencies in UI tests directory - run: npm ci - - - name: Install browsers - run: npx playwright install --with-deps - - - name: Generate mocha reports with failed steps - run: GENERATE_FAILED_STEPS=true npm run test:all - continue-on-error: true - - - name: Checking doubles in steps identifiers - run: npm run check:step-identifiers - - suites: - runs-on: ubuntu-latest - name: Checking Suites Count - - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright/ - key: ${{ runner.os }}-browsers - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install dependencies in UI tests directory - run: npm ci - - - name: Install browsers - run: npx playwright install --with-deps - - - name: Checking that all suites are executed - run: npm run check:suites