Skip to content

Commit

Permalink
Clean up plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Aug 14, 2023
1 parent 77e48e9 commit cd102f5
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 231 deletions.
17 changes: 0 additions & 17 deletions .github/dependabot.yml

This file was deleted.

90 changes: 72 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ env:

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

runs-on: "ubuntu-latest"

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

dependencies:
- "highest"
Expand Down Expand Up @@ -50,25 +50,40 @@ jobs:
- name: "Check style"
run: "composer check-style"

- name: "Rector"
run: "vendor/bin/rector process --dry-run"

- 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)"

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

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

dependencies:
- "lowest"
- "highest"

symfony:
- "^5.4"
- "^6.0"

exclude:
- php-version: "7.4"
symfony: "^6.0"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
Expand All @@ -79,86 +94,125 @@ jobs:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "composer-require-checker, composer-unused"
tools: "composer-require-checker, composer-unused, flex"

- name: "Remove require-dev section in composer.json"
run: "composer config --unset require-dev"

- 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"
run: "composer-require-checker check"

- name: "Run composer-unused/composer-unused"
run: "composer-unused"

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

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

dependencies:
- "lowest"
- "highest"

symfony:
- "^5.4"
- "^6.0"

exclude:
- php-version: "7.4"
symfony: "^6.0"

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

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

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

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

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

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

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

dependencies:
- "lowest"
- "highest"

symfony:
- "^5.4"
- "^6.0"

exclude:
- php-version: "7.4"
symfony: "^6.0"

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

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

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

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

- name: "Run phpspec"
run: "composer phpspec"

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

- name: "Run phpspec"
run: "composer phpspec"

integration-tests:
name: "Integration tests"
Expand Down Expand Up @@ -241,14 +295,14 @@ jobs:
if-no-files-found: "ignore"

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

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.2"

dependencies:
- "highest"
Expand Down
10 changes: 2 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"doctrine/persistence": "^1.3 || ^2.1",
"league/uri": "^6.0",
"league/uri-components": "^2.3",
"setono/symfony-main-request-trait": "^1.0",
"sylius/resource-bundle": "^1.6",
"symfony/config": "^5.4 || ^6.0",
"symfony/console": "^5.4 || ^6.0",
Expand Down Expand Up @@ -44,8 +43,7 @@
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.16",
"weirdan/doctrine-psalm-plugin": "^2.8"
"symfony/webpack-encore-bundle": "^1.16"
},
"prefer-stable": true,
"autoload": {
Expand All @@ -70,12 +68,8 @@
"sort-packages": true
},
"scripts": {
"analyse": [
"@ensure-test-container-exists",
"psalm"
],
"analyse": "psalm",
"check-style": "ecs check",
"ensure-test-container-exists": "[[ -f tests/Application/var/cache/test/ApplicationTests_Setono_SyliusRedirectPlugin_Application_KernelTestDebugContainer.xml ]] || tests/Application/bin/console cache:warmup --env=test",
"fix-style": "ecs check --fix",
"phpspec": "phpspec run",
"phpunit": "phpunit",
Expand Down
Loading

0 comments on commit cd102f5

Please sign in to comment.