Skip to content

Commit

Permalink
Merge branch 'main' into test/ci-ps-php-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
fox-john authored Jan 10, 2025
2 parents e57dbad + f6409b9 commit 3b85c97
Show file tree
Hide file tree
Showing 482 changed files with 23,025 additions and 21,029 deletions.
27 changes: 27 additions & 0 deletions .config.inte.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/

return [
'ps_eventbus.proxy_api_url' => 'https://eventbus-proxy.psessentials-integration.net',
'ps_eventbus.sync_api_url' => 'https://eventbus-sync.psessentials-integration.net',
'ps_eventbus.live_sync_api_url' => 'https://api.cloudsync-integration.prestashop.com/live-sync/v1',
'ps_eventbus.sentry_dsn' => 'https://457f191226df4b8f9a0d7bf6f250bab2@o298402.ingest.sentry.io/6066714',
'ps_eventbus.sentry_env' => 'integration',
];
6 changes: 0 additions & 6 deletions .config.inte.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .config.prod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/

return [
'ps_eventbus.proxy_api_url' => 'https://eventbus-proxy.psessentials.net',
'ps_eventbus.sync_api_url' => 'https://eventbus-sync.psessentials.net',
'ps_eventbus.live_sync_api_url' => 'https://api.cloudsync.prestashop.com/live-sync/v1',
'ps_eventbus.sentry_dsn' => 'https://457f191226df4b8f9a0d7bf6f250bab2@o298402.ingest.sentry.io/6066714',
'ps_eventbus.sentry_env' => 'production',
];
6 changes: 0 additions & 6 deletions .config.prod.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/README_CI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Github CI/CD

## Dependencies

### Github

- [actions/checkout@v4](https://github.com/actions/checkout)
- [actions/cache@v4](https://github.com/actions/cache)
- [actions/setup-node@v4](https://github.com/actions/setup-node)

### pnpm

- [pnpm/action-setup@v4](https://github.com/pnpm/action-setup)

### Others

- [shivammathur/setup-php@v2](https://github.com/shivammathur/setup-php)
- [softprops/action-gh-release@v2](https://github.com/softprops/action-gh-release)
- [dsaltares/fetch-gh-release-asset@master](https://github.com/dsaltares/fetch-gh-release-asset)
- [mheap/github-action-required-labels@v5](https://github.com/mheap/github-action-required-labels)
- [rtCamp/action-slack-notify@v2](https://github.com/rtCamp/action-slack-notify)
8 changes: 4 additions & 4 deletions .github/workflows/build-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
ref: ${{ github.ref }}

- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: latest

Expand All @@ -36,7 +36,7 @@ jobs:
cache-dependency-path: e2e/pnpm-lock.yaml

- name: Cache vendor folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand All @@ -61,7 +61,7 @@ jobs:
run: |
cp .env.dist .env
docker compose build
docker compose up --detach --wait
docker compose --profile cicd up --detach --wait
env:
DOCKER_IMAGE_PRESTASHOP: prestashop/prestashop-flashlight:${{matrix.ps_version}}
working-directory: e2e-env
Expand All @@ -74,7 +74,7 @@ jobs:
if: failure()
run: |
docker compose logs cloudsync-mock
docker compose down -v
docker compose --profile cicd down -v
working-directory: e2e-env

upload_release_assets:
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Cache vendor folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand All @@ -54,14 +54,14 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# @TODO: "1.6.1.24" is temporarily disabled here
ps_version: ["1.6.1.11", "1.7.8.10", "8.1.6"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache vendor folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand All @@ -76,7 +76,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Cache vendor folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand All @@ -89,6 +89,7 @@ jobs:
timeout-minutes: 30
if: ${{ github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
ps_version: ["1.6.1.11", "1.7.8.10", "8.1.4", "nightly"]
steps:
Expand All @@ -97,7 +98,7 @@ jobs:
with:
ref: ${{ github.ref }}

- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: latest

Expand All @@ -108,11 +109,14 @@ jobs:
cache-dependency-path: e2e/pnpm-lock.yaml

- name: Cache vendor folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

- name: install php dependencies
run: composer install

- name: Install dependencies and setup e2e
run: pnpm install --no-optional --force
working-directory: e2e
Expand All @@ -121,7 +125,7 @@ jobs:
run: |
cp .env.dist .env
docker compose build
docker compose up --detach --wait
docker compose --profile cicd up --detach --wait
env:
DOCKER_IMAGE_PRESTASHOP: prestashop/prestashop-flashlight:${{matrix.ps_version}}
working-directory: e2e-env
Expand All @@ -134,7 +138,7 @@ jobs:
if: failure()
run: |
docker compose logs cloudsync-mock prestashop
docker compose down -v
docker compose --profile cicd down -v
working-directory: e2e-env

e2e-lint:
Expand All @@ -148,7 +152,7 @@ jobs:
with:
ref: ${{ github.ref }}

- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: latest

Expand All @@ -159,7 +163,7 @@ jobs:
cache-dependency-path: e2e/pnpm-lock.yaml

- name: Cache vendor folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/radis-to-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
name: Is ready 🥕
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v3
- uses: mheap/github-action-required-labels@v5
with:
mode: minimum
count: 1
labels: "🥕 Radis to review"
- uses: mheap/github-action-required-labels@v3
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 0
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ e2e/dumps
sonar-project.properties

*.cache

### Mytuns
credentials.json
14 changes: 14 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
<Files *.php>
order allow,deny
deny from all
</Files>
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
<Files *.php>
Require all denied
</Files>
</IfModule>
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
->exclude('vendor');

$config = (new PrestaShop\CodingStandards\CsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setUsingCache(false)
->setFinder($finder);

Expand Down
2 changes: 2 additions & 0 deletions .zip-contents
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ src
upgrade
vendor
ps_eventbus.php
config.php
logo.png
config.xml
LICENSE
README.md
composer.json
composer.lock
.htaccess
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ zip: zip-prod zip-inte zip-e2e
# target: zip-e2e - Bundle a local E2E integrable zip
.PHONY: zip-e2e
zip-e2e: vendor tools/vendor dist
@$(call zip_it,./config/parameters.yml,${PACKAGE}_e2e.zip)
@$(call zip_it,./config.php,${PACKAGE}_e2e.zip)

# target: zip-inte - Bundle an integration zip
.PHONY: zip-inte
zip-inte: vendor tools/vendor dist
@$(call zip_it,.config.inte.yml,${PACKAGE}_integration.zip)
@$(call zip_it,.config.inte.php,${PACKAGE}_integration.zip)

# target: zip-prod - Bundle a production zip
.PHONY: zip-prod
zip-prod: vendor tools/vendor dist
@$(call zip_it,.config.prod.yml,${PACKAGE}.zip)
@$(call zip_it,.config.prod.php,${PACKAGE}.zip)

# target: zip-unzipped - Bundle a production module, but without zip step (only to check sources)
.PHONY: zip-unzipped
zip-unzipped: vendor tools/vendor dist
@$(call no_zip_it,.config.prod.yml)
@$(call no_zip_it,.config.prod.php)

dist:
@mkdir -p ./dist
Expand Down Expand Up @@ -151,9 +151,14 @@ docker-phpunit-cov: tools/vendor
.PHONY: phpstan docker-phpstan
phpstan: tools/vendor prestashop/prestashop-${PS_VERSION}
phpstan analyse --memory-limit=-1 --configuration=./tests/phpstan/phpstan-local.neon;
docker-phpstan:
docker-phpstan: tools/vendor
@$(call in_docker,/usr/bin/phpstan,analyse --memory-limit=-1 --configuration=./tests/phpstan/phpstan-docker.neon)

# target: header-stamp - check Headers of PHP files
.PHONY:header-stamp
header-stamp:
tools/vendor/bin/header-stamp --license=tools/vendor/prestashop/header-stamp/assets/osl3.txt --exclude=vendor,tools,e2e,e2e-env,tests,composer.json,scoper.inc.php

define COMMENT
Fixme: add "allure-framework/allure-phpunit" in composer.json to solve this.
Currently failing to resolve devDeps:
Expand All @@ -178,7 +183,8 @@ define create_module
cp -r $(shell cat .zip-contents) ${TMP_DIR}/${MODULE_NAME};
$(call replace_version,${TMP_DIR}/${MODULE_NAME},${SEM_VERSION})
./tools/vendor/bin/autoindex prestashop:add:index ${TMP_DIR}
cp $1 ${TMP_DIR}/${MODULE_NAME}/config/parameters.yml
tools/vendor/bin/header-stamp --target=${TMP_DIR}/${MODULE_NAME} --license=tools/vendor/prestashop/header-stamp/assets/osl3.txt --exclude=vendor,e2e,e2e-env,tests,composer.json,scoper.inc.php
cp $1 ${TMP_DIR}/${MODULE_NAME}/config.php
cd ${TMP_DIR}/${MODULE_NAME} && composer dump-autoload
endef

Expand Down
Loading

0 comments on commit 3b85c97

Please sign in to comment.