Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/spec export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/composer-require-checker.json export-ignore
/ecs.php export-ignore
/phpspec.yml.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/README.md export-ignore
/.editorconfig export-ignore
/node_modules export-ignore
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/composer-dependency-analyser.php export-ignore
/ecs.php export-ignore
/infection.json5 export-ignore
/node_modules export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/rector.php export-ignore
/tests export-ignore
/UPGRADE.md export-ignore
281 changes: 48 additions & 233 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,279 +1,94 @@
name: "build"

on:
push:
branches:
- "*.x"
paths-ignore:
- "**/*.md"
pull_request:
paths-ignore:
- "**/*.md"
push: ~
pull_request: ~
workflow_dispatch: ~

env:
APP_ENV: "test"
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=8.0"
PHP_EXTENSIONS: "intl, mbstring"

jobs:
coding-standards:
name: "Coding Standards (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }})"

backwards-compatibility:
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4" # Always use the lowest version of PHP since a higher version would create actual syntax errors in lower versions

dependencies:
- "highest"

if: "github.event_name == 'pull_request'"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- uses: "setono/sylius-plugin/backwards-compatibility@v2"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
coverage: "none"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Validate composer"
run: "composer validate --strict"

- name: "Check composer normalized"
run: "composer normalize --dry-run"

- name: "Check style"
run: "composer check-style"

- name: "Lint yaml files"
run: "(cd tests/Application && bin/console lint:yaml ../../src/Resources)"

- name: "Lint twig files"
run: "(cd tests/Application && bin/console lint:twig ../../src/Resources)"
coding-standards:
runs-on: "ubuntu-latest"
steps:
- uses: "setono/sylius-plugin/coding-standards@v2"

dependency-analysis:
name: "Dependency Analysis (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"

runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
- "highest"

symfony:
- "^5.4"

php-version: ["8.2", "8.3", "8.4"]
dependencies: ["lowest", "highest"]
symfony: ["~6.4.0", "~7.4.0"]
steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
- uses: "setono/sylius-plugin/dependency-analysis@v2"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "composer-require-checker, composer-unused, flex"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run maglnet/composer-require-checker"
run: "composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"

- name: "Run composer-unused/composer-unused"
run: "composer-unused"
dependencies: "${{ matrix.dependencies }}"
symfony: "${{ matrix.symfony }}"

static-code-analysis:
name: "Static Code Analysis (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"

runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
- "highest"

symfony:
- "^5.4"

php-version: ["8.2", "8.3", "8.4"]
dependencies: ["lowest", "highest"]
symfony: ["~6.4.0", "~7.4.0"]
steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
- uses: "setono/sylius-plugin/static-code-analysis@v2"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "flex"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Cache warmup"
run: "(cd tests/Application && bin/console cache:warmup)"

- name: "Static analysis"
run: "vendor/bin/psalm --php-version=${{ matrix.php-version }}"
dependencies: "${{ matrix.dependencies }}"
symfony: "${{ matrix.symfony }}"

unit-tests:
name: "Unit tests (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"

runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
- "highest"

symfony:
- "^5.4"

php-version: ["8.2", "8.3", "8.4"]
dependencies: ["lowest", "highest"]
symfony: ["~6.4.0", "~7.4.0"]
steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
- uses: "setono/sylius-plugin/unit-tests@v2"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "flex"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run phpunit"
run: "composer phpunit"

integration-tests:
name: "Integration tests (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"
dependencies: "${{ matrix.dependencies }}"
symfony: "${{ matrix.symfony }}"
testsuite: "unit"

functional-tests:
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
- "highest"

symfony:
- "^5.4"

php-version: ["8.2", "8.3", "8.4"]
dependencies: ["highest"]
symfony: ["~6.4.0", "~7.4.0"]
steps:
- name: "Start MySQL"
run: "sudo /etc/init.d/mysql start"

- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
- uses: "setono/sylius-plugin/functional-tests@v2"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "flex"
dependencies: "${{ matrix.dependencies }}"
symfony: "${{ matrix.symfony }}"
testsuite: "functional"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
mutation-tests:
runs-on: "ubuntu-latest"
steps:
- uses: "setono/sylius-plugin/mutation-tests@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Lint container"
run: "(cd tests/Application && bin/console lint:container)"

- name: "Create database"
run: "(cd tests/Application && bin/console doctrine:database:create -vvv)"

- name: "Create database schema"
run: "(cd tests/Application && bin/console doctrine:schema:create -vvv)"

- name: "Validate Doctrine mapping"
run: "(cd tests/Application && bin/console doctrine:schema:validate -vvv)"
stryker-dashboard-api-key: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"

code-coverage:
name: "Code Coverage (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }})"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.1"

dependencies:
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
- uses: "setono/sylius-plugin/code-coverage@v2"
with:
coverage: "pcov"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Collect code coverage with pcov and phpunit/phpunit"
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml"

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: "bash <(curl -s https://codecov.io/bash)"
codecov-token: "${{ secrets.CODECOV_TOKEN }}"
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/.build/
/vendor/
/node_modules/
/composer.lock

/etc/build/*
!/etc/build/.gitignore

/tests/Application/yarn.lock
/tests/Application/config/reference.php

/.phpunit.cache

# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project
/.php-version
/php.ini

/behat.yml
/phpspec.yml
/.claude/
/.phpunit.result.cache
Loading
Loading