diff --git a/.github/workflows/recipe.yaml b/.github/workflows/recipe.yaml index c5e522b..c4b117c 100644 --- a/.github/workflows/recipe.yaml +++ b/.github/workflows/recipe.yaml @@ -9,33 +9,22 @@ jobs: recipe: - runs-on: ubuntu-latest + name: Flex recipe (PHP ${{ matrix.php }}, Sylius ${{ matrix.sylius }}) - env: - SYMFONY_ENDPOINT: http://127.0.0.1/ + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1'] - sylius: ['~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0'] + php: ['8.0', '8.1', '8.2'] + sylius: ['~1.11.0', '~1.12.0'] include: - php: '8.1' sylius: '~1.12.0' sylius_paypal: '~1.5.0' - exclude: - - php: '8.0' - sylius: '~1.8.0' - - php: '8.0' - sylius: '~1.9.0' - - php: '8.1' - sylius: '~1.8.0' - - php: '8.1' - sylius: '~1.9.0' - - php: '7.4' - sylius: '~1.11.0' - - php: '7.4' + - php: '8.2' sylius: '~1.12.0' + sylius_paypal: '~1.5.0' steps: - name: Setup PHP @@ -43,23 +32,15 @@ jobs: with: php-version: ${{ matrix.php }} extensions: gd, intl, json - ini-values: date.timezone=UTC - name: Set project php-version run: | - echo ${{ matrix.php }} > .php-version + echo "${{ matrix.php }}" > .php-version - uses: actions/checkout@v3 with: path: plugin - # Run the server at the start so it can download the recipes! - - name: Run standalone symfony flex server - run: | - echo ${{ github.token }} | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - docker run --rm --name flex -d -v $PWD/plugin/recipes:/var/www/flex/var/repo/private/monsieurbiz/sylius-cms-page-plugin -p 80:80 docker.pkg.github.com/monsieurbiz/docker/symfony-flex-server:latest contrib official - docker ps - - run: mkdir -p /home/runner/{.composer/cache,.config/composer} - uses: actions/cache@v3 @@ -69,9 +50,6 @@ jobs: key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ github.sha }} restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}- - - name: Update composer - run: sudo composer self-update - - name: Composer Github Auth run: composer config -g github-oauth.github.com ${{ github.token }} @@ -84,7 +62,7 @@ jobs: working-directory: ./sylius run: | composer require --no-install --no-scripts --no-progress sylius/sylius="${{ matrix.sylius }}" - + # Fix Paypal 1.5 on Sylius 1.12 and PHP 8.1 - name: Make sure to install the required version of Sylius Paypal Plugin if: ${{ matrix.sylius_paypal }} @@ -96,20 +74,13 @@ jobs: working-directory: ./sylius run: | composer config --no-plugins allow-plugins true - composer config repositories.plugin '{"type": "path", "url": "../plugin/"}' - composer config extra.symfony.allow-contrib true - composer config secure-http false - composer config --unset platform.php - - - name: Require plugin without install - working-directory: ./sylius - run: | - composer require --no-install --no-scripts monsieurbiz/sylius-cms-page-plugin="*@dev" + composer config --no-plugins extra.symfony.allow-contrib true + composer config --no-plugins secure-http false + composer config --no-plugins --unset platform.php + composer config --no-plugins extra.symfony.docker false + composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]' - - name: Composer install + - name: Require plugin & install all dependencies working-directory: ./sylius run: | - composer install - - - name: Show flex server logs - run: docker logs --tail 100 flex + composer require monsieurbiz/sylius-cms-page-plugin="*@dev" diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 78a624c..67a89bb 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -8,12 +8,14 @@ jobs: security: + name: Security check (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1'] + php: ['8.0', '8.1', '8.2'] steps: - uses: actions/checkout@v3 @@ -23,11 +25,10 @@ jobs: with: php-version: ${{ matrix.php }} extensions: gd, intl, json - ini-values: date.timezone=UTC - name: Set project php-version run: | - echo ${{ matrix.php }} > .php-version + echo "${{ matrix.php }}" > .php-version - uses: actions/cache@v3 id: cache-composer @@ -38,9 +39,6 @@ jobs: - run: mkdir -p /home/runner/{.composer/cache,.config/composer} - - name: Update composer - run: sudo composer self-update - - name: Composer Github Auth run: composer config -g github-oauth.github.com ${{ github.token }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f7934f1..04d68ad 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,12 +9,14 @@ jobs: php: + name: Quality tests (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - php: ['8.0', '8.1'] + php: ['8.0', '8.1', '8.2'] env: SYMFONY_ARGS: --no-tls @@ -23,21 +25,19 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: gd, intl, json - ini-values: date.timezone=UTC - name: Set project php-version run: | - echo ${{ matrix.php }} > .php-version + echo "${{ matrix.php }}" > .php-version - name: Install symfony CLI run: | @@ -53,9 +53,6 @@ jobs: - run: mkdir -p /home/runner/{.composer/cache,.config/composer} - - name: Update composer - run: sudo composer self-update - - name: Composer Github Auth run: composer config -g github-oauth.github.com ${{ github.token }} diff --git a/Makefile b/Makefile index 93113b2..2c55fb3 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ SYMFONY=cd ${APP_DIR} && symfony COMPOSER=symfony composer CONSOLE=${SYMFONY} console export COMPOSE_PROJECT_NAME=cms-page +export MIGRATIONS_NAMESPACE=MonsieurBiz\\SyliusCmsPagePlugin\\Migrations export USER_UID=$(shell id -u) PLUGIN_NAME=sylius-${COMPOSE_PROJECT_NAME}-plugin COMPOSE=docker-compose @@ -138,7 +139,7 @@ test.container: ## Lint the symfony container ${CONSOLE} lint:container test.yaml: ## Lint the symfony Yaml files - ${CONSOLE} lint:yaml ../../recipes ../../src/Resources/config + ${CONSOLE} lint:yaml ../../src/Resources/config test.schema: ## Validate MySQL Schema ${CONSOLE} doctrine:schema:validate @@ -169,6 +170,9 @@ sylius.assets: ## Install all assets with symlinks messenger.setup: ## Setup Messenger transports ${CONSOLE} messenger:setup-transports +doctrine.diff: ## Doctrine diff + ${CONSOLE} doctrine:migration:diff --namespace="${MIGRATIONS_NAMESPACE}" + ### ### PLATFORM ### ¯¯¯¯¯¯¯¯ diff --git a/composer.json b/composer.json index 0232627..f516d74 100644 --- a/composer.json +++ b/composer.json @@ -64,6 +64,13 @@ "phpspec": "phpspec run" }, "extra": { + "symfony": { + "docker": false, + "endpoint": [ + "https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master", + "flex://defaults" + ] + }, "branch-alias": { "dev-master": "1.0-dev" } diff --git a/recipes/1.0-dev/config/packages/monsieurbiz_sylius_cms_page_plugin.yaml b/recipes/1.0-dev/config/packages/monsieurbiz_sylius_cms_page_plugin.yaml deleted file mode 100644 index 361e712..0000000 --- a/recipes/1.0-dev/config/packages/monsieurbiz_sylius_cms_page_plugin.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "@MonsieurBizSyliusCmsPagePlugin/Resources/config/config.yaml" } diff --git a/recipes/1.0-dev/config/routes/monsieurbiz_sylius_cms_page_plugin.yaml b/recipes/1.0-dev/config/routes/monsieurbiz_sylius_cms_page_plugin.yaml deleted file mode 100644 index 90bade6..0000000 --- a/recipes/1.0-dev/config/routes/monsieurbiz_sylius_cms_page_plugin.yaml +++ /dev/null @@ -1,9 +0,0 @@ -monsieurbiz_cms_page_admin: - resource: "@MonsieurBizSyliusCmsPagePlugin/Resources/config/routing/admin.yaml" - prefix: /%sylius_admin.path_name% - -monsieurbiz_cms_page_shop: - resource: "@MonsieurBizSyliusCmsPagePlugin/Resources/config/routing/shop.yaml" - prefix: /{_locale} - requirements: - _locale: "^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$" diff --git a/recipes/1.0-dev/manifest.json b/recipes/1.0-dev/manifest.json deleted file mode 100644 index 7d43969..0000000 --- a/recipes/1.0-dev/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "bundles": { - "MonsieurBiz\\SyliusCmsPagePlugin\\MonsieurBizSyliusCmsPagePlugin": [ - "all" - ] - }, - "copy-from-recipe": { - "config/": "%CONFIG_DIR%/" - } -} diff --git a/src/Migrations/Version20240613100143.php b/src/Migrations/Version20240613100143.php new file mode 100644 index 0000000..6696afd --- /dev/null +++ b/src/Migrations/Version20240613100143.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace MonsieurBiz\SyliusCmsPagePlugin\Migrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20240613100143 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE monsieurbiz_cms_page_translation CHANGE metaTitle meta_title VARCHAR(255) DEFAULT NULL, CHANGE metaKeywords meta_keywords VARCHAR(255) DEFAULT NULL, CHANGE metaDescription meta_description LONGTEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE monsieurbiz_cms_page_translation CHANGE meta_title metaTitle VARCHAR(255) DEFAULT NULL, CHANGE meta_keywords metaKeywords VARCHAR(255) DEFAULT NULL, CHANGE meta_description metaDescription LONGTEXT DEFAULT NULL'); + } +} diff --git a/src/Resources/config/doctrine/PageTranslation.orm.xml b/src/Resources/config/doctrine/PageTranslation.orm.xml index 4bce5a9..2d237b6 100644 --- a/src/Resources/config/doctrine/PageTranslation.orm.xml +++ b/src/Resources/config/doctrine/PageTranslation.orm.xml @@ -12,9 +12,9 @@ - - - + + +