Skip to content

Commit

Permalink
[TASK] Raise supported versions to TYPO3 13
Browse files Browse the repository at this point in the history
* [TASK] Allow TYPO3 13

* [TASK] update github action workflow

---------

Co-authored-by: Simon Schaufelberger <simonschaufi@users.noreply.github.com>
  • Loading branch information
Kanti and simonschaufi committed Aug 5, 2024
1 parent ae01a4c commit 3b40f25
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 82 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,37 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.4', '8.0', '8.1' ]
TYPO3: [ '11' ]
include:
- TYPO3: '12'
php: '8.1'
- TYPO3: '12'
php: '8.2'
- TYPO3: '10'
php: '7.4'
# TYPO3 10: PHP 7.2 - 7.4
- TYPO3: '10'
php: '7.2'
- TYPO3: '10'
php: '7.3'
- TYPO3: '10'
php: '7.4'
# TYPO3 11: PHP 7.4 - 8.3
- TYPO3: '11'
php: '7.4'
- TYPO3: '11'
php: '8.0'
- TYPO3: '11'
php: '8.1'
- TYPO3: '11'
php: '8.2'
- TYPO3: '11'
php: '8.3'
# TYPO3 12: PHP 8.1 - 8.3
- TYPO3: '12'
php: '8.1'
- TYPO3: '12'
php: '8.2'
- TYPO3: '12'
php: '8.3'
# TYPO3 13: PHP 8.2 - 8.3
- TYPO3: '13'
php: '8.2'
- TYPO3: '13'
php: '8.3'
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
58 changes: 29 additions & 29 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env bash

#
# TYPO3 core test runner based on docker and docker-compose.
# TYPO3 core test runner based on docker and docker compose.
#

# Function to write a .env file in Build/testing-docker
# This is read by docker-compose and vars defined here are
# This is read by docker compose and vars defined here are
# used in Build/testing-docker/docker-compose.yml
setUpDockerComposeDotEnv() {
# Delete possibly existing local .env file if exists
[ -e .env ] && rm .env
# Set up a new .env file for docker-compose
# Set up a new .env file for docker compose
{
echo "COMPOSE_PROJECT_NAME=local"
# To prevent access rights of files created by the testing, the docker image later
# runs with the same user that is currently executing the script. docker-compose can't
# runs with the same user that is currently executing the script. docker compose can't
# use $UID directly itself since it is a shell variable and not an env variable, so
# we have to set it explicitly here.
echo "HOST_UID=`id -u`"
Expand All @@ -40,7 +40,7 @@ read -r -d '' HELP <<EOF
make test runner. Execute unit test suite and some other details.
Also used by github actions for test execution.
Successfully tested with docker version 18.06.1-ce and docker-compose 1.21.2.
Successfully tested with docker version 18.06.1-ce and docker compose 1.21.2.
Usage: $0 [options] [file]
Expand All @@ -58,7 +58,7 @@ Options:
- phpstan: phpstan analyze
- unit (default): PHP unit tests
-t <10|11|12>
-t <10|11|12|13>
Only with -s composerInstall|acceptance|functional
TYPO3 core major version the extension is embedded in for testing.
Expand All @@ -69,7 +69,7 @@ Options:
- postgres: use postgres
- sqlite: use sqlite
-p <7.2|7.3|7.4|8.0|8.1|8.2>
-p <7.2|7.3|7.4|8.0|8.1|8.2|8.3>
Specifies the PHP minor version to be used
- 7.4 (default): use PHP 7.4
Expand Down Expand Up @@ -114,9 +114,9 @@ Examples:
./Build/Scripts/runTests.sh -p 7.3
EOF

# Test if docker-compose exists, else exit out with error
if ! type "docker-compose" > /dev/null; then
echo "This script relies on docker and docker-compose. Please install" >&2
# Test if docker compose exists, else exit out with error
if ! type "docker" > /dev/null; then
echo "This script relies on docker and docker compose. Please install" >&2
exit 1
fi

Expand Down Expand Up @@ -163,7 +163,7 @@ while getopts ":s:d:p:e:t:xy:nhuv" OPT; do
;;
p)
PHP_VERSION=${OPTARG}
if ! [[ ${PHP_VERSION} =~ ^(7.2|7.3|7.4|8.0|8.1|8.2)$ ]]; then
if ! [[ ${PHP_VERSION} =~ ^(7.2|7.3|7.4|8.0|8.1|8.2|8.3)$ ]]; then
INVALID_OPTIONS+=("${OPTARG}")
fi
;;
Expand Down Expand Up @@ -230,46 +230,46 @@ fi
case ${TEST_SUITE} in
acceptance)
setUpDockerComposeDotEnv
docker-compose run acceptance_backend_mariadb10
docker compose run --rm acceptance_backend_mariadb10
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
cgl)
# Active dry-run for cgl needs not "-n" but specific options
if [ -n "${CGLCHECK_DRY_RUN}" ]; then
CGLCHECK_DRY_RUN="--dry-run --diff"
fi
setUpDockerComposeDotEnv
docker-compose run cgl
docker compose run --rm cgl
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
composerInstall)
setUpDockerComposeDotEnv
docker-compose run composer_install
docker compose run --rm composer_install
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
composerValidate)
setUpDockerComposeDotEnv
docker-compose run composer_validate
docker compose run --rm composer_validate
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
functional)
setUpDockerComposeDotEnv
case ${DBMS} in
mariadb)
docker-compose run functional_mariadb10
docker compose run --rm functional_mariadb10
SUITE_EXIT_CODE=$?
;;
postgres)
docker-compose run functional_postgres10
docker compose run --rm functional_postgres10
SUITE_EXIT_CODE=$?
;;
sqlite)
mkdir -p ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
docker-compose run functional_sqlite
docker compose run --rm functional_sqlite
SUITE_EXIT_CODE=$?
;;
*)
Expand All @@ -278,25 +278,25 @@ case ${TEST_SUITE} in
echo "${HELP}" >&2
exit 1
esac
docker-compose down
docker compose down
;;
lint)
setUpDockerComposeDotEnv
docker-compose run lint
docker compose run --rm lint
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
phpstan)
setUpDockerComposeDotEnv
docker-compose run phpstan
docker compose run --rm phpstan
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
unit)
setUpDockerComposeDotEnv
docker-compose run unit
docker compose run --rm unit
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
update)
# pull typo3/core-testing-*:latest versions of those ones that exist locally
Expand Down
75 changes: 37 additions & 38 deletions Build/testing-docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2.3'
services:
chrome:
image: selenium/standalone-chrome:3.141.59-20210713
Expand Down Expand Up @@ -35,13 +34,13 @@ services:
command: >
/bin/sh -c "
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
XDEBUG_MODE=\"off\" \\
php -S web:8000 -t ${CORE_ROOT}/.Build/Web
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
XDEBUG_MODE=\"debug,develop\" \\
XDEBUG_TRIGGER=\"foo\" \\
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \\
php -S web:8000 -t ${CORE_ROOT}/.Build/Web
fi
"
Expand Down Expand Up @@ -78,13 +77,13 @@ services:
mkdir -p Web/typo3temp/var/tests/
COMMAND=\"vendor/codeception/codeception/codecept run Backend -d -c Web/typo3conf/ext/make/Tests/codeception.yml ${TEST_FILE}\"
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
XDEBUG_MODE=\"off\" \\
$${COMMAND};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
XDEBUG_MODE=\"debug,develop\" \\
XDEBUG_TRIGGER=\"foo\" \\
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \\
$${COMMAND};
fi
"
Expand All @@ -105,22 +104,22 @@ services:
fi
php -v | grep '^PHP';
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
php -dxdebug.mode=off \
.Build/bin/php-cs-fixer fix \
-v \
${CGLCHECK_DRY_RUN} \
--config=Build/php-cs-fixer.php \
php -dxdebug.mode=off \\
.Build/bin/php-cs-fixer fix \\
-v \\
${CGLCHECK_DRY_RUN} \\
--config=Build/php-cs-fixer.php \\
--using-cache=no .
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
PHP_CS_FIXER_ALLOW_XDEBUG=1 \
.Build/bin/php-cs-fixer fix \
-v \
${CGLCHECK_DRY_RUN} \
--config=Build/php-cs-fixer.php \
XDEBUG_MODE=\"debug,develop\" \\
XDEBUG_TRIGGER=\"foo\" \\
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \\
PHP_CS_FIXER_ALLOW_XDEBUG=1 \\
.Build/bin/php-cs-fixer fix \\
-v \\
${CGLCHECK_DRY_RUN} \\
--config=Build/php-cs-fixer.php \\
--using-cache=no .
fi
"
Expand Down Expand Up @@ -199,13 +198,13 @@ services:
echo Database is up;
php -v | grep '^PHP';
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
XDEBUG_MODE=\"off\" \\
bin/phpunit -c Web/typo3conf/ext/make/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
XDEBUG_MODE=\"debug,develop\" \\
XDEBUG_TRIGGER=\"foo\" \\
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \\
bin/phpunit -c Web/typo3conf/ext/make/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
fi
"
Expand Down Expand Up @@ -239,13 +238,13 @@ services:
echo Database is up;
php -v | grep '^PHP';
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
XDEBUG_MODE=\"off\" \\
bin/phpunit -c Web/typo3conf/ext/make/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
XDEBUG_MODE=\"debug,develop\" \\
XDEBUG_TRIGGER=\"foo\" \\
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \\
bin/phpunit -c Web/typo3conf/ext/make/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE};
fi
"
Expand All @@ -270,13 +269,13 @@ services:
fi
php -v | grep '^PHP';
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
XDEBUG_MODE=\"off\" \\
bin/phpunit -c Web/typo3conf/ext/make/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
XDEBUG_MODE=\"debug,develop\" \\
XDEBUG_TRIGGER=\"foo\" \\
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \\
bin/phpunit -c Web/typo3conf/ext/make/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE};
fi
"
Expand Down Expand Up @@ -332,13 +331,13 @@ services:
fi
php -v | grep '^PHP';
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
XDEBUG_MODE=\"off\" \\
bin/phpunit -c ../Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
XDEBUG_MODE=\"debug,develop\" \\
XDEBUG_TRIGGER=\"foo\" \\
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \\
bin/phpunit -c ../Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
fi
"
7 changes: 4 additions & 3 deletions Classes/Command/ExtensionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$availableTypo3Versions = [
'^10.4' => 'TYPO3 v10 LTS',
'^11.5' => 'TYPO3 v11 LTS',
'^12.0' => 'TYPO3 v12 LTS',
'^12.4' => 'TYPO3 v12 LTS',
'^13.0' => 'TYPO3 v13',
];
$question = $this->io->askQuestion((new ChoiceQuestion(
'Choose supported TYPO3 versions (comma separate for multiple)',
array_combine([10, 11, 12], array_values($availableTypo3Versions)),
11
array_combine([10, 11, 12, 13], array_values($availableTypo3Versions)),
12
))->setMultiselect(true));

$supportedTypo3Versions = [];
Expand Down
4 changes: 2 additions & 2 deletions Classes/Component/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ protected function getTypo3Constraint(): string
$min = $this->typo3Versions[array_key_first($this->typo3Versions)];
$max = $this->typo3Versions[array_key_last($this->typo3Versions)];

// While ^12.0 will also include upcoming sprint releases,
// While ^13.0 will also include upcoming sprint releases,
// we need to set minor version "4" for the max version.
// @todo Should be handled more efficient
if ($max === '^12.0') {
if ($max === '^13.0') {
$max = str_replace('.0', '.4', $max);
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"typo3/cms-core": "^10.0 || ^11.0 || ^12.0"
"typo3/cms-core": "^10.0 || ^11.0 || ^12.0 || ^13.0"
},
"require-dev": {
"phpstan/phpstan": "^1.4",
Expand Down
Loading

0 comments on commit 3b40f25

Please sign in to comment.