Skip to content

Commit

Permalink
Improve build
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Nov 8, 2023
1 parent 9a9118d commit 6a3a11f
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 25 deletions.
87 changes: 81 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "build"
on:
push:
branches:
- "0.*"
- "0.*.x"
paths-ignore:
- "**/*.md"
pull_request:
Expand Down Expand Up @@ -71,13 +71,36 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

dependencies:
- "lowest"
- "highest"

symfony:
- "^5.4"
- "~6.0.0"
- "~6.1.0"
- "~6.2.0"
- "~6.3.0"

exclude:
- php-version: "7.4"
symfony: "~6.0.0"
- php-version: "7.4"
symfony: "~6.1.0"
- php-version: "7.4"
symfony: "~6.2.0"
- php-version: "7.4"
symfony: "~6.3.0"
- php-version: "8.0"
symfony: "~6.0.0"
- php-version: "8.0"
symfony: "~6.1.0"
- php-version: "8.0"
symfony: "~6.2.0"
- php-version: "8.0"
symfony: "~6.3.0"

steps:
- name: "Checkout"
Expand Down Expand Up @@ -118,12 +141,36 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

dependencies:
- "lowest"
- "highest"

symfony:
- "^5.4"
- "~6.0.0"
- "~6.1.0"
- "~6.2.0"
- "~6.3.0"

exclude:
- php-version: "7.4"
symfony: "~6.0.0"
- php-version: "7.4"
symfony: "~6.1.0"
- php-version: "7.4"
symfony: "~6.2.0"
- php-version: "7.4"
symfony: "~6.3.0"
- php-version: "8.0"
symfony: "~6.0.0"
- php-version: "8.0"
symfony: "~6.1.0"
- php-version: "8.0"
symfony: "~6.2.0"
- php-version: "8.0"
symfony: "~6.3.0"

steps:
- name: "Checkout"
Expand All @@ -137,16 +184,16 @@ jobs:
php-version: "${{ matrix.php-version }}"
tools: "flex"

- name: "Remove sylius/sylius from composer.json"
run: "composer remove --dev --no-update --no-plugins --no-scripts sylius/sylius"

- 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: "composer analyse"

Expand All @@ -161,12 +208,36 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

dependencies:
- "lowest"
- "highest"

symfony:
- "^5.4"
- "~6.0.0"
- "~6.1.0"
- "~6.2.0"
- "~6.3.0"

exclude:
- php-version: "7.4"
symfony: "~6.0.0"
- php-version: "7.4"
symfony: "~6.1.0"
- php-version: "7.4"
symfony: "~6.2.0"
- php-version: "7.4"
symfony: "~6.3.0"
- php-version: "8.0"
symfony: "~6.0.0"
- php-version: "8.0"
symfony: "~6.1.0"
- php-version: "8.0"
symfony: "~6.2.0"
- php-version: "8.0"
symfony: "~6.3.0"

steps:
- name: "Checkout"
Expand All @@ -180,6 +251,9 @@ jobs:
php-version: "${{ matrix.php-version }}"
tools: "flex"

- name: "Remove sylius/sylius from composer.json"
run: "composer remove --dev --no-update --no-plugins --no-scripts sylius/sylius"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
env:
Expand All @@ -201,6 +275,7 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

dependencies:
- "highest"
Expand All @@ -226,7 +301,7 @@ jobs:
- name: "Setup node"
uses: "actions/setup-node@v3"
with:
node-version: "14"
node-version: "16"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
Expand Down Expand Up @@ -315,7 +390,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"

dependencies:
- "highest"
Expand Down
14 changes: 2 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"webmozart/assert": "^1.11"
},
"require-dev": {
"friendsofsymfony/oauth-server-bundle": ">2.0.0-alpha.0 ^2.0@dev",
"lexik/jwt-authentication-bundle": "^2.16",
"matthiasnoback/symfony-config-test": "^4.3",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
Expand All @@ -69,7 +68,7 @@
"psalm/plugin-symfony": "^5.0",
"setono/code-quality-pack": "^2.4",
"setono/sylius-behat-pack": "^0.2.2",
"setono/sylius-catalog-promotion-plugin": "^0.4",
"setono/sylius-catalog-promotion-plugin": "^0.4.8 || ^0.5",
"sylius/sylius": "~1.10.14",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
Expand Down Expand Up @@ -104,20 +103,12 @@
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"scripts": {
"all": [
"@checks",
"@tests"
],
"analyse": [
"@ensure-test-container-exists",
"psalm"
],
"analyse": "psalm",
"assets": [
"@ensure-assets-installed",
"@ensure-assets-compiled"
Expand All @@ -140,7 +131,6 @@
"ensure-env-dev-copied": "(cd tests/Application && ([[ -f .env.local ]] || cp .env .env.local))",
"ensure-env-test-copied": "(cd tests/Application && ([[ -f .env.test.local ]] || cp .env.test .env.test.local))",
"ensure-schema-updated": "composer ensure-env-copied && (cd tests/Application && bin/console doctrine:schema:update --force -e ${SYMFONY_ENV:-'dev'})",
"ensure-test-container-exists": "[[ -f tests/Application/var/cache/test/Tests_Setono_SyliusGiftCardPlugin_Application_KernelTestDebugContainer.xml ]] || tests/Application/bin/console cache:warmup --env=test",
"ensure-vendors-installed": "[[ -f vendor/autoload.php ]] || php -d memory_limit=-1 /usr/local/bin/composer install",
"fix-style": "ecs check --fix",
"fixtures": [
Expand Down
4 changes: 1 addition & 3 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
</ignoreFiles>
</projectFiles>
<plugins>
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin">
<containerXml>tests/Application/var/cache/test/Tests_Setono_SyliusGiftCardPlugin_Application_KernelTestDebugContainer.xml</containerXml>
</pluginClass>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
<pluginClass class="Weirdan\DoctrinePsalmPlugin\Plugin"/>
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin"/>
</plugins>
<forbiddenFunctions>
<function name="dd"/>
Expand Down
8 changes: 4 additions & 4 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private function addResourcesSection(ArrayNodeDefinition $node): void

private function addGiftCardSection(NodeBuilder $nodeBuilder): void
{
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod */
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod,PossiblyUndefinedMethod */
$nodeBuilder
->arrayNode('gift_card')
->addDefaultsIfNotSet()
Expand All @@ -110,7 +110,7 @@ private function addGiftCardSection(NodeBuilder $nodeBuilder): void

private function addGiftCardConfigurationSection(NodeBuilder $nodeBuilder): void
{
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod */
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod,PossiblyUndefinedMethod */
$nodeBuilder
->arrayNode('gift_card_configuration')
->addDefaultsIfNotSet()
Expand All @@ -129,7 +129,7 @@ private function addGiftCardConfigurationSection(NodeBuilder $nodeBuilder): void

private function addGiftCardConfigurationImageSection(NodeBuilder $nodeBuilder): void
{
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod */
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod,PossiblyUndefinedMethod */
$nodeBuilder
->arrayNode('gift_card_configuration_image')
->addDefaultsIfNotSet()
Expand All @@ -148,7 +148,7 @@ private function addGiftCardConfigurationImageSection(NodeBuilder $nodeBuilder):

private function addChannelConfigurationSection(NodeBuilder $nodeBuilder): void
{
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod */
/** @psalm-suppress MixedMethodCall,PossiblyNullReference,UndefinedInterfaceMethod,PossiblyUndefinedMethod */
$nodeBuilder
->arrayNode('gift_card_channel_configuration')
->addDefaultsIfNotSet()
Expand Down

0 comments on commit 6a3a11f

Please sign in to comment.