Skip to content

Commit

Permalink
Add Sylius 1.13 and PHP 8.3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lanfisis committed Jan 14, 2025
1 parent cdb83d7 commit 8d14e56
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 38 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ on:
pull_request:

jobs:

recipe:

name: Flex recipe (PHP ${{ matrix.php }}, Sylius ${{ matrix.sylius }})


runs-on: ubuntu-latest

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

php: ['8.1', '8.2', '8.3']
sylius: [ "~1.11.0", "~1.12.0", "~1.13.0"]
exclude:
- php: '8.3'
sylius: '~1.11.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 Down Expand Up @@ -57,7 +59,7 @@ jobs:
- name: Create Sylius-Standard project without install
run: |
composer create-project --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard sylius "${{ matrix.sylius }}"
# Because the sylius-standard has a soft constraint
- name: Make sure to install the required version of Sylius
working-directory: ./sylius
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ jobs:

security:

name: Security check (PHP ${{ matrix.php }})

runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v3
Expand All @@ -28,7 +26,7 @@ jobs:

- 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
Expand All @@ -39,7 +37,7 @@ jobs:
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-

- name: Ensure that composer cache directory exists
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,36 @@ on:
pull_request:

jobs:

php:

name: Quality tests (PHP ${{ matrix.php }})


runs-on: ubuntu-latest

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

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

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'

node-version: '14'
- 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: Install symfony CLI
run: |
curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | sudo -E bash
sudo apt install symfony-cli
echo "${{ matrix.php }}" > .php-version
- name: Determine composer cache directory
id: composer-cache-directory
Expand All @@ -54,7 +46,7 @@ jobs:
id: cache-composer
with:
path: ${{ steps.composer-cache-directory.outputs.directory }}
key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-

- name: Ensure that composer cache directory exists
Expand All @@ -69,10 +61,14 @@ jobs:

- run: make test.phpcs

- run: make test.phpunit

- run: make test.phpstan

- run: make test.phpmd

- run: make test.phpspec

- run: make test.yaml

- run: make test.twig
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DEFAULT_GOAL := help
SHELL=/bin/bash
APP_DIR=tests/Application
SYLIUS_VERSION=1.12.0
SYLIUS_VERSION=1.13.0
SYMFONY=cd ${APP_DIR} && symfony
COMPOSER=symfony composer
CONSOLE=${SYMFONY} console
Expand Down Expand Up @@ -110,7 +110,7 @@ apply_dist:
### TESTS
### ¯¯¯¯¯

test.all: test.composer test.phpstan test.phpmd test.phpcs test.yaml test.schema test.twig test.container ## Run all tests in once
test.all: test.composer test.phpstan test.phpmd test.phpcs test.phpunit test.yaml test.schema test.twig test.container ## Run all tests in once

test.composer: ## Validate composer.json
${COMPOSER} validate --strict
Expand All @@ -121,6 +121,9 @@ test.phpstan: ## Run PHPStan
test.phpmd: ## Run PHPMD
${COMPOSER} phpmd

test.phpunit: ## Run PHPUnit
${COMPOSER} phpunit

test.phpcs: ## Run PHP CS Fixer in dry-run
${COMPOSER} run -- phpcs --dry-run -v

Expand All @@ -131,7 +134,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 --parse-tags

test.schema: ## Validate MySQL Schema
${CONSOLE} doctrine:schema:validate
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ machine events.

![Demo of the Order History](docs/images/demo.png)

## Compatibility

| Sylius Version | PHP Version |
|---|---|

| 1.11 | 8.1 - 8.2 |
| 1.12 | 8.1 - 8.3 |
| 1.13 | 8.1 - 8.3 |

## Installation

Install the plugin via composer:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": "~8.0",
"sylius/sylius": ">=1.9 <1.13",
"sylius/sylius": ">=1.11 <1.14",
"beberlei/doctrineextensions": "^1.3"
},
"prefer-stable": true,
Expand Down

0 comments on commit 8d14e56

Please sign in to comment.