Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3 #1484

Draft
wants to merge 48 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b2f606b
L2
sreichel Nov 13, 2024
74abc71
L3
sreichel Nov 13, 2024
40ab60b
L3 - docs
sreichel Nov 13, 2024
f0c2b4c
L4
sreichel Nov 13, 2024
a63ad81
L5
sreichel Nov 13, 2024
03bcfa0
revert change
sreichel Nov 22, 2024
b4e0eb2
updated .phpstan.dist.baseline.neon
sreichel Nov 25, 2024
f7ac56e
rectored
sreichel Nov 25, 2024
ebb900f
added ext-dom
sreichel Nov 25, 2024
2efb17b
phpstan L6
sreichel Nov 25, 2024
80d5f14
phpstan L7
sreichel Dec 11, 2024
0d36c26
PER-CS2.0
sreichel Dec 12, 2024
0221962
update
sreichel Dec 12, 2024
96e42b0
rector
sreichel Dec 12, 2024
0e04d53
rector
sreichel Dec 12, 2024
b6d5ab6
Merge remote-tracking branch 'origin/phpstan' into phpstan
sreichel Dec 12, 2024
7c07452
update composer
sreichel Dec 14, 2024
0ba907a
last fixes
sreichel Dec 14, 2024
1563f5a
Merge branch 'develop' into phpstan
sreichel Dec 14, 2024
b0d4ddf
workflow
sreichel Dec 14, 2024
02dfb07
last fixes
sreichel Dec 16, 2024
aeb94e4
reset tests
sreichel Dec 16, 2024
a4480b5
last fixes
sreichel Dec 16, 2024
7256617
php-cs-fixer
sreichel Dec 16, 2024
9d65963
phpstan
sreichel Dec 16, 2024
bd91142
rector
sreichel Dec 16, 2024
f91279b
rector tests
sreichel Dec 16, 2024
35541e7
fix test
sreichel Dec 16, 2024
cda04a9
updated phing
sreichel Dec 16, 2024
1ae9011
rector ....
sreichel Dec 16, 2024
8891505
workflow
sreichel Dec 16, 2024
0173a28
latest version
sreichel Dec 16, 2024
aad1214
workflow
sreichel Dec 16, 2024
c19bf04
typo
sreichel Dec 16, 2024
23ead54
fix3?
sreichel Dec 16, 2024
347e2cb
rector
sreichel Dec 16, 2024
a955ef2
workflow
sreichel Dec 16, 2024
ea5d463
.phpunit.dist.xml
sreichel Dec 16, 2024
cea0c6a
skip one test (tmp)
sreichel Dec 16, 2024
b3fe74b
skip another test (tmp)
sreichel Dec 16, 2024
fb8d005
test
sreichel Dec 16, 2024
0311af1
skip last test (tmp)
sreichel Dec 16, 2024
84881c0
skip last test (tmp)
sreichel Dec 16, 2024
2a6ff08
use getcwd for rootpath
sreichel Dec 18, 2024
48a13f0
fix
sreichel Dec 18, 2024
057b4ce
revert change
sreichel Dec 18, 2024
d07e28e
Merge branch 'develop' into phpstan
sreichel Dec 18, 2024
9c64bce
fix
sreichel Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .ddev/commands/web/php-cs-fixer
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

## Description: run PHP-CS-Fixer
## Usage: php-cs-fixer
## Example: ddev php-cs-fixer <path-to-files>

php vendor/bin/php-cs-fixer fix "$@"
7 changes: 7 additions & 0 deletions .ddev/commands/web/rector
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

## Description: run rector
## Usage: rector
## Example: ddev rector <path-to-files>

php vendor/bin/rector process --config .rector.php "$@"
28 changes: 28 additions & 0 deletions .github/workflows/composer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Composer

on:
workflow_call:
workflow_dispatch:

jobs:
composer:
name: Validation
runs-on: [ubuntu-latest]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Validate composer
run: composer validate --strict --no-check-all
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
env:
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
run: bash .github/workflows/update-dist-repo.sh
run: bash .github/workflows/scripts/update-dist-repo.sh

create-github-release:
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/phar_build_and_update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
name: Phar build and update test

on: [push, pull_request]
on:
workflow_call:
workflow_dispatch:

jobs:
build:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: PHP-CS-Fixer

on:
push:
pull_request:
workflow_call:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/php_compatibility.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: PHP Compatibility

on:
- push
- pull_request
workflow_call:
workflow_dispatch:

env:
MIN_PHP_VERSION: 7.4
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: PHPStan

on:
push:
pull_request:
workflow_call:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Rector

on:
workflow_call:
workflow_dispatch:

jobs:
php-cs-fixer:
name: Rector
runs-on: [ubuntu-latest]

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Checkout code
uses: actions/checkout@v4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*

- name: PHP-CS-Fixer
run: php vendor/bin/rector process --config .rector.php --dry-run
8 changes: 5 additions & 3 deletions .github/workflows/test-magento-open-source.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test Magento Open Source 1.9 with PHP 7.4

on: [push, pull_request]
on:
workflow_call:
workflow_dispatch:

jobs:
test-magento-open-source-1-9:
Expand All @@ -20,7 +22,7 @@ jobs:
- uses: actions/checkout@v4

- name: Linux Setup
run: ./.github/workflows/linux-setup.sh
run: ./.github/workflows/scripts/linux-setup.sh

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -68,7 +70,7 @@ jobs:
run: echo "N98_MAGERUN_TEST_MAGENTO_ROOT=${{ github.workspace }}/magento" >> $GITHUB_ENV

- name: Run tests
run: php -f vendor/bin/phpunit
run: php vendor/bin/phpunit --configuration .phpunit.dist.xml
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-openmage-20.0.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test OpenMage 20.0.x

on: [push, pull_request]
on:
workflow_call:
workflow_dispatch:

jobs:
test-openmage-20-0-marix:
Expand All @@ -27,7 +29,7 @@ jobs:
- uses: actions/checkout@v4

- name: Linux Setup
run: ./.github/workflows/linux-setup.sh
run: ./.github/workflows/scripts/linux-setup.sh

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -75,7 +77,7 @@ jobs:
run: echo "N98_MAGERUN_TEST_MAGENTO_ROOT=${{ github.workspace }}/magento" >> $GITHUB_ENV

- name: Run tests
run: php -f vendor/bin/phpunit
run: php vendor/bin/phpunit --configuration .phpunit.dist.xml
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test-openmage-20.1.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

name: Test OpenMage 20.1.x

on: [push, pull_request]
on:
workflow_call:
workflow_dispatch:

jobs:
test-openmage-20-1-matrix:
Expand All @@ -28,7 +29,7 @@ jobs:
- uses: actions/checkout@v4

- name: Linux Setup
run: ./.github/workflows/linux-setup.sh
run: ./.github/workflows/scripts/linux-setup.sh

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -76,7 +77,7 @@ jobs:
run: echo "N98_MAGERUN_TEST_MAGENTO_ROOT=${{ github.workspace }}/magento" >> $GITHUB_ENV

- name: Run tests
run: php -f vendor/bin/phpunit
run: php vendor/bin/phpunit --configuration .phpunit.dist.xml
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test-openmage-20.10.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

name: Test OpenMage 20.10.x

on: [push, pull_request]
on:
workflow_call:
workflow_dispatch:

jobs:
test-openmage-20-9-matrix:
Expand All @@ -10,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
openmage_version: ["20.10.0"]
openmage_version: ["20.10.2"]
php_version: ["8.3", "8.2", "8.1", "7.4"]
mysql_version: ["8.0", "5.7"]

Expand All @@ -28,7 +29,7 @@ jobs:
- uses: actions/checkout@v4

- name: Linux Setup
run: ./.github/workflows/linux-setup.sh
run: ./.github/workflows/scripts/linux-setup.sh

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -76,7 +77,7 @@ jobs:
run: echo "N98_MAGERUN_TEST_MAGENTO_ROOT=${{ github.workspace }}/magento" >> $GITHUB_ENV

- name: Run tests
run: php -f vendor/bin/phpunit
run: php vendor/bin/phpunit --configuration .phpunit.dist.xml
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
pull_request:

jobs:
composer:
name: Composer
uses: ./.github/workflows/composer.yml

php_compatibility:
name: Composer
uses: ./.github/workflows/php_compatibility.yml

php-cs-fixer:
name: PHP CS Fixer
needs: [composer]
uses: ./.github/workflows/php-cs-fixer.yml

phpstan:
name: PHPStan
needs: [composer, php-cs-fixer]
uses: ./.github/workflows/phpstan.yml

rector:
name: Rector
needs: [composer, php-cs-fixer]
uses: ./.github/workflows/rector.yml

unit_tests_magento_opensource:
name: PHPUnit Magento1
needs: [composer, php-cs-fixer, phpstan, rector]
uses: ./.github/workflows/test-magento-open-source.yml

unit_tests_om_20_0:
name: PHPUnit OpenMage 20.0
needs: [composer, php-cs-fixer, phpstan, rector]
uses: ./.github/workflows/test-openmage-20.0.yml

unit_tests_om_20_1:
name: PHPUnit OpenMage 20.1
needs: [composer, php-cs-fixer, phpstan, rector]
uses: ./.github/workflows/test-openmage-20.1.yml

unit_tests_om_20_10:
name: PHPUnit OpenMage 20.10
needs: [composer, php-cs-fixer, phpstan, rector]
uses: ./.github/workflows/test-openmage-20.10.yml

build_phar:
name: Build Phar
needs: [composer, php-cs-fixer, phpstan, rector, unit_tests_magento_opensource, unit_tests_om_20_0, unit_tests_om_20_1, unit_tests_om_20_10]
uses: ./.github/workflows/phar_build_and_update.yml
36 changes: 26 additions & 10 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
declare(strict_types=1);

$finder = (new Finder())
->in('.');

return (new Config())
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
'array_syntax' => ['syntax' => 'short'],
'modernize_types_casting' => true,
// see https://cs.symfony.com/doc/ruleSets/PER-CS2.0.html
'@PER-CS2.0' => true,
// RISKY: Use && and || logical operators instead of and or.
'logical_operators' => true,
// RISKY: Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator.
'modernize_types_casting' => true,
// PHP84: Adds or removes ? before single type declarations or |null at the end of union types when parameters have a default null value.
'nullable_type_declaration_for_default_null_value' => true,
// Convert double quotes to single quotes for simple strings.
'single_quote' => true,
]);
// Arguments lists, array destructuring lists, arrays that are multi-line, match-lines and parameters lists must have a trailing comma.
// removed "match" and "parameters" for PHP7
// see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8308
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'array_destructuring', 'arrays']],
])
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
);
23 changes: 0 additions & 23 deletions .php_cs

This file was deleted.

File renamed without changes.
Loading
Loading