Skip to content

Commit

Permalink
Add Sylius 1.13 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
maximehuran committed Jul 10, 2024
1 parent 944931c commit 9efe478
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 267 deletions.
75 changes: 32 additions & 43 deletions .github/workflows/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ jobs:

recipe:

name: Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}

runs-on: ubuntu-latest

env:
SYMFONY_ENDPOINT: http://127.0.0.1/

strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
sylius: ['~1.10.0', '~1.11.0', '~1.12.0']
sylius: ["~1.11.0", "~1.12.0", "~1.13.0"]
exclude:
- php: '8.2'
sylius: '~1.11.0'
- php: '8.0'
sylius: '~1.12.0'
- php: '8.0'
sylius: '~1.13.0'

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd, intl, json
ini-values: date.timezone=UTC
tools: symfony-cli

- name: Set project php-version
run: |
Expand All @@ -37,33 +41,24 @@ jobs:
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-settings-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}

- name: Determine composer cache directory
id: composer-cache-directory
working-directory: plugin
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Determine composer cache directory
id: composer-cache-directory
working-directory: plugin
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies installed with composer
uses: actions/cache@v3
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ hashFiles('**/composer.json') }}
restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-
- name: Cache dependencies installed with composer
uses: actions/cache@v3
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ hashFiles('**/composer.json') }}
restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-

- name: Ensure that composer cache directory exists
run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }}
- name: Ensure that composer cache directory exists
run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }}

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}
- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- name: Create Sylius-Standard project without install
run: |
Expand All @@ -79,20 +74,14 @@ jobs:
working-directory: ./sylius
run: |
composer config --no-plugins allow-plugins true
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"]'
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
- name: Require plugin & install all dependencies
working-directory: ./sylius
run: |
composer require --no-install --no-scripts monsieurbiz/sylius-settings-plugin="*@dev"
- name: Composer install
working-directory: ./sylius
run: |
composer install
- name: Show flex server logs
run: docker logs --tail 100 flex
composer require monsieurbiz/sylius-settings-plugin="*@dev"
37 changes: 18 additions & 19 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ on:
jobs:

security:

name: PHP ${{ matrix.php }}

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
php: ['8.1', '8.2']

steps:
- uses: actions/checkout@v3
Expand All @@ -24,31 +22,32 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone=UTC
extensions: gd, intl, json

- name: Set project php-version
run: |
echo ${{ matrix.php }} > .php-version
echo "${{ matrix.php }}" > .php-version
- name: Determine composer cache directory
id: composer-cache-directory
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Determine composer cache directory
id: composer-cache-directory
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies installed with composer
uses: actions/cache@v3
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: composer2-php:${{ matrix.php }}-
- name: Cache dependencies installed with composer
uses: actions/cache@v3
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-

- name: Ensure that composer cache directory exists
run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }}
- name: Ensure that composer cache directory exists
run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }}

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}
- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- name: Install PHP dependencies
run: composer update --prefer-dist

- uses: symfonycorp/security-checker-action@v4

65 changes: 31 additions & 34 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,62 @@ on:
jobs:

php:

name: PHP ${{ matrix.php }}

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
php: ['8.1', '8.2']

env:
SYMFONY_ARGS: --no-tls
COMPOSER_ARGS: --prefer-dist
DOCKER_INTERACTIVE_ARGS: -t

steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd, intl, json
ini-values: date.timezone=UTC
tools: symfony-cli

- name: Set project php-version
run: |
echo "${{ matrix.php }}" > .php-version
- name: Determine composer cache directory
id: composer-cache-directory
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies installed with composer
uses: actions/cache@v3
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone=UTC
tools: symfony-cli

- name: Set project php-version
run: |
echo ${{ matrix.php }} > .php-version
- name: Determine composer cache directory
id: composer-cache-directory
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies installed with composer
uses: actions/cache@v3
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: composer2-php:${{ matrix.php }}-

- name: Ensure that composer cache directory exists
run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }}
- name: Ensure that composer cache directory exists
run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }}

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}
- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- run: make install

- run: make sylius.fixtures.local

- run: make test.composer

- run: make test.phpcs

- run: make test.phpunit

- run: make test.phpstan

- run: make test.phpmd
Expand Down
8 changes: 4 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'comment_to_phpdoc' => true,
'compact_nullable_typehint' => true,
'compact_nullable_type_declaration' => true,
'concat_space' => [
'spacing' => 'one',
],
Expand Down Expand Up @@ -120,7 +120,7 @@
],
'native_constant_invocation' => true,
'native_function_casing' => true,
'new_with_braces' => true,
'new_with_parentheses' => true,
'no_alias_functions' => true,
'no_alternative_syntax' => true,
'no_blank_lines_after_class_opening' => true,
Expand Down Expand Up @@ -159,14 +159,14 @@
'no_short_bool_cast' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'spaces_inside_parentheses' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'no_unset_cast' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_braces' => true,
'no_unneeded_final_method' => true,
'no_unset_on_property' => true,
'no_unused_imports' => true,
Expand Down
Loading

0 comments on commit 9efe478

Please sign in to comment.