-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from PrestaShopCorp/feat/packaging
chore: full packaging review
- Loading branch information
Showing
22 changed files
with
4,731 additions
and
66 deletions.
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,3 @@ | ||
{ | ||
"error": "This is a mock, it should not be published on the addons marketplace" | ||
} |
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,111 @@ | ||
name: Release and publish | ||
on: | ||
release: | ||
types: [released, prereleased] | ||
|
||
env: | ||
PHP_BUILDER_VERSION: "8.3" | ||
NODE_BUILDER_VERSION: "20" | ||
DOCKER_COMPOSE_VERSION: v2.27.0 | ||
GITHUB_TOKEN: ${{ secrets.GA_ACCESS_TOKEN }} | ||
VERSION: ${{ github.event.release.tag_name }} | ||
|
||
jobs: | ||
e2e_tests: | ||
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
if: github.event.release.tag_name != 'staging' | ||
strategy: | ||
matrix: | ||
ps_version: ["1.7.8.10", "8.1.7"] | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Cache vendor folder | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
|
||
- name: Install docker compose | ||
run: | | ||
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} | ||
mkdir -p $DOCKER_CONFIG/cli-plugins | ||
rm -f $DOCKER_CONFIG/cli-plugins/docker-compose | ||
curl -SL https://github.com/docker/compose/releases/download/${{ env.DOCKER_COMPOSE_VERSION }}/docker-compose-linux-x86_64 \ | ||
-o $DOCKER_CONFIG/cli-plugins/docker-compose | ||
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose | ||
- name: Setup e2e-env with Prestashop ${{ matrix.ps_version }} | ||
run: | | ||
cp .env.dist .env | ||
docker compose build | ||
docker compose up --detach --wait | ||
env: | ||
DOCKER_IMAGE_PRESTASHOP: prestashop/prestashop-flashlight:${{matrix.ps_version}} | ||
working-directory: e2e-env | ||
|
||
# - name: Run e2e:tests with Prestashop ${{ matrix.ps_version }} | ||
# run: pnpm test:e2e | ||
# working-directory: e2e | ||
|
||
- name: More logs on failure | ||
if: failure() | ||
run: | | ||
docker compose logs prestashop | ||
docker compose down -v | ||
working-directory: e2e-env | ||
|
||
upload_release_assets: | ||
name: Upload zip assets to the release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ env.PHP_BUILDER_VERSION }} | ||
|
||
- name: Bundle zip | ||
run: make zip | ||
env: | ||
VERSION: ${{ github.event.release.tag_name }} | ||
|
||
- name: Get short commit sha | ||
id: commit | ||
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: Upload the zip assets | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
./dist/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip | ||
./dist/${{ github.event.repository.name }}.zip | ||
./dist/ps_accounts.zip | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: ${{ github.event.release.tag_name == 'staging' && format('🐣 staging (commit {0})', steps.commit.outputs.sha) || github.event.release.tag_name }} | ||
|
||
notify_earth: | ||
name: Notify slack internal channels about the release | ||
needs: | ||
- upload_release_assets | ||
- e2e_tests | ||
if: success() | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_COLOR: 8FCE00 | ||
SLACK_TITLE: "🚀 PS Accounts Mock ${{ github.event.release.tag_name }} has been released" | ||
SLACK_MESSAGE: ${{ github.event.release.body }} | ||
SLACK_FOOTER: "https://github.com/PrestaShopCorp/ps_eventbus/releases/tag/${{ github.event.release.tag_name }}" | ||
SLACK_USERNAME: QABot | ||
SLACK_CHANNEL: squad-cloudsync | ||
SLACK_ICON: https://raw.githubusercontent.com/PrestaShopCorp/ps_eventbus/main/logo.png |
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,118 @@ | ||
name: Quality Control | ||
|
||
env: | ||
DOCKER_COMPOSE_VERSION: v2.27.0 | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
php-linter: | ||
name: PHP Syntax check | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
matrix: | ||
php_version: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: PHP syntax checker ${{ matrix.php_version }} | ||
run: make docker-php-lint | ||
env: | ||
PHP_VERSION: ${{ matrix.php_version }} | ||
TESTING_IMAGE: php:${{ matrix.php_version }} | ||
|
||
composer-validate: | ||
name: Composer validate | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run composer validate | ||
run: make composer-validate | ||
|
||
php-cs-fixer: | ||
name: PHP-CS-FIXER | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cache vendor folder | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
- name: Run PHP-CS-Fixer | ||
run: make lint | ||
|
||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
matrix: | ||
# @TODO: "1.6.1.24" is temporarily disabled here | ||
ps_version: ["1.7.8.10", "8.1.6"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cache vendor folder | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
- name: PHPStan PrestaShop ${{ matrix.ps_version }} | ||
run: PS_VERSION="${{ matrix.ps_version }}" make docker-phpstan | ||
|
||
e2e-tests: | ||
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
strategy: | ||
matrix: | ||
ps_version: ["1.7.8.10", "8.1.4", "nightly"] | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Cache vendor folder | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
|
||
- name: Install docker compose | ||
run: | | ||
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} | ||
mkdir -p $DOCKER_CONFIG/cli-plugins | ||
rm -f $DOCKER_CONFIG/cli-plugins/docker-compose | ||
curl -SL https://github.com/docker/compose/releases/download/${{ env.DOCKER_COMPOSE_VERSION }}/docker-compose-linux-x86_64 \ | ||
-o $DOCKER_CONFIG/cli-plugins/docker-compose | ||
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose | ||
- name: Setup e2e-env with Prestashop ${{ matrix.ps_version }} | ||
run: | | ||
cp .env.dist .env | ||
docker compose build | ||
docker compose up --detach --wait | ||
env: | ||
DOCKER_IMAGE_PRESTASHOP: prestashop/prestashop-flashlight:${{matrix.ps_version}} | ||
working-directory: e2e-env | ||
|
||
# - name: Run e2e:tests with Prestashop ${{ matrix.ps_version }} | ||
# run: pnpm test:e2e | ||
# working-directory: e2e | ||
|
||
- name: More logs on failure | ||
if: failure() | ||
run: | | ||
docker compose logs prestashop | ||
docker compose down -v | ||
working-directory: e2e-env |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.env | ||
dist/ | ||
vendor/ | ||
prestashop/ | ||
|
||
# Composer | ||
composer.phar | ||
|
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,14 @@ | ||
<?php | ||
|
||
$finder = (new PhpCsFixer\Finder()) | ||
->in(__DIR__) | ||
->exclude('prestashop') | ||
->exclude('dist') | ||
->exclude('tools') | ||
->exclude('vendor'); | ||
|
||
$config = (new PrestaShop\CodingStandards\CsFixer\Config()) | ||
->setUsingCache(false) | ||
->setFinder($finder); | ||
|
||
return $config; |
Oops, something went wrong.