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
51 changes: 32 additions & 19 deletions .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
name: Tasks

on: [push, pull_request]

'on':
- push
- pull_request
jobs:
lint-php:
name: "php: ${{ matrix.php }} TYPO3: ${{ matrix.typo3 }}"
compatibility:
name: Compatibility PHP ${{ matrix.php }} / TYPO3 ${{ matrix.typo3 }} / ${{ matrix.dependencies }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.2', '8.3', '8.4' ]
typo3: [ '12', '13' ]
include:
- php: '8.2'
typo3: '13'
dependencies: latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependencies: latest

This isn't necessary; we didn't have it before, and we don't need it now either.

- php: '8.3'
typo3: '13'
dependencies: latest
- php: '8.4'
typo3: '13'
dependencies: latest
- php: '8.5'
typo3: '13'
dependencies: latest
- php: '8.2'
typo3: '13'
dependencies: lowest
- php: '8.5'
typo3: '13'
dependencies: lowest
steps:
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-composer-
- run: composer require typo3/minimal="^${{ matrix.typo3 }}" --dev --ignore-platform-req=php+
- run: composer install --no-interaction --no-progress --ignore-platform-req=php+
- run: ./vendor/bin/grumphp run --ansi
extensions: apcu, bcmath, gd, intl, mbstring, pdo_sqlite, sqlite3, zip
coverage: pcov
tools: composer:v2
ini-values: apc.enable_cli=1, memory_limit=1G
- name: Resolve and check compatibility
run: sh Build/Scripts/check-compatibility.sh ${{ matrix.php }} ${{ matrix.typo3 }} ${{ matrix.dependencies }}
Comment on lines -19 to +41

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not change that much in a simple php upgrade.

3 changes: 3 additions & 0 deletions Build/Configuration/PHP/testing.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apc.enable_cli=1
memory_limit=1G
error_reporting=E_ALL
46 changes: 46 additions & 0 deletions Build/Scripts/check-compatibility.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not want a shell script for this, we do not need this here.
We did not have this before.

set -eu

php_version="${1:?PHP version required}"
typo3_version="${2:?TYPO3 major required}"
dependencies="${3:-latest}"

php -r 'exit(PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION === $argv[1] ? 0 : 1);' "$php_version"
php -v
composer self-update --2 --no-interaction
composer --version
case "$php_version:$typo3_version" in
8.2:13|8.3:13|8.4:13|8.5:13) ;;
*) printf 'Unsupported PHP/TYPO3 pair: %s / %s\n' "$php_version" "$typo3_version"; exit 1 ;;
esac
case "$dependencies" in latest|lowest) ;; *) exit 1 ;; esac

export GRUMPHP_GIT_HOOKS_ENABLED=0
export typo3DatabaseDriver=pdo_sqlite
export XDEBUG_MODE=off
export PHP_INI_SCAN_DIR="${PHP_INI_SCAN_DIR:-}:$(pwd)/Build/Configuration/PHP"

composer validate --no-check-publish --no-interaction
composer config lock true
composer require --dev --sort-packages 'squizlabs/php_codesniffer:^3.8.0 || ^4.0' --no-update --no-interaction
case "$typo3_version" in
13)
constraint='^13.4'
composer require --dev --sort-packages 'saschaegerer/phpstan-typo3:^2.2.0' 'ssch/typo3-rector:^3.16.0' 'rector/rector:^2.7.0' 'pluswerk/grumphp-config:^11.2.0' --no-update --no-interaction
;;
esac
composer require --dev --sort-packages "typo3/minimal:$constraint" --no-update --no-interaction
if [ "$php_version" = 8.5 ]; then
composer require --dev --sort-packages 'phpunit/phpunit:^10.5.62 || ^11.5.50 || ^12.5.0 || ^13.0.2' --no-update --no-interaction
fi
if [ "$dependencies" = lowest ]; then
composer update --with-all-dependencies --prefer-lowest --prefer-stable --no-interaction --no-progress --no-scripts
else
composer update --with-all-dependencies --prefer-stable --no-interaction --no-progress --no-scripts
fi
composer check-platform-reqs
if [ "$php_version" = 8.5 ]; then
composer prohibits php 8.5.0 || true
fi

php vendor/bin/grumphp run --no-interaction
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
],
"type": "typo3-cms-extension",
"require": {
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"typo3/cms-core": "^12.4 || ^13.4",
"typo3/cms-frontend": "^12.4 || ^13.4"
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"typo3/cms-core": "^13.4",
"typo3/cms-frontend": "^13.4"
},
"require-dev": {
"pluswerk/grumphp-config": "^7.2.0 || ^10.1.4",
"pluswerk/grumphp-config": "^7.2.0 || ^10.1.4 || ^11.2.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove version 7 or even version 10?

"saschaegerer/phpstan-typo3": "^1.10.2 || ^2.1.1",
"ssch/typo3-rector": "*"
},
Expand All @@ -22,6 +22,7 @@
},
"config": {
"allow-plugins": {
"a9f/fractor-extension-installer": true,
"ergebnis/composer-normalize": true,
"phpro/grumphp": true,
"phpstan/extension-installer": true,
Expand Down
4 changes: 4 additions & 0 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
imports:
- { resource: vendor/pluswerk/grumphp-config/grumphp.yml }
grumphp:
parallel:
enabled: false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we disable parallel runs?

parameters:
convention.fractor_enable: false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we disable fractor?

convention.process_timeout: 240
convention.security_checker_blocking: false
convention.jsonlint_ignore_pattern: { }
Expand Down
3 changes: 1 addition & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

use PLUS\GrumPHPConfig\RectorSettings;
use Rector\Config\RectorConfig;
use Rector\Caching\ValueObject\Storage\FileCacheStorage;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(80200);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not want a fixed version. We have the automated php version configuration.

$rectorConfig->parallel();
$rectorConfig->importNames();
$rectorConfig->importShortClasses();
$rectorConfig->cacheClass(FileCacheStorage::class);
$rectorConfig->cacheDirectory('./var/cache/rector');

$rectorConfig->paths(
Expand Down
Loading