Skip to content

Commit

Permalink
Add support for more PHP versions in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sypets committed Feb 5, 2024
1 parent 7e98f97 commit 98ec2fc
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# statics checks
# - run only with latest TYPO3 and PHP version
# unit / functional tests
# - run with more PHP versions
name: CI

on:
Expand All @@ -8,14 +8,12 @@ on:

jobs:

testsuite_ci_static:
testsuite_ci:
name: CI static
runs-on: ubuntu-20.04
strategy:
matrix:
# run static checks only with latest PHP version (for supported TYPO3 versions)
php: [ '8.1' ]
# run static checks only with latest TYPO3 version
php: [ '8.1', '8.2', '8.3' ]
minMax: [ 'composerInstallMax' ]
steps:
- name: Checkout
Expand All @@ -24,15 +22,6 @@ jobs:
- name: Composer
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s ${{ matrix.minMax }}

- name: Composer validate
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate

- name: cgl
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s cgl -v -n

- name: Lint PHP
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lint

# - name: Unit tests
# run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit

Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/tests_static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# statics checks
# - run only with latest TYPO3 and PHP version
name: CI (static)

on:
push:
pull_request:

jobs:

testsuite_ci_static:
name: CI static
runs-on: ubuntu-20.04
strategy:
matrix:
# run static checks only with latest PHP version (for supported TYPO3 versions)
#php: [ '8.1', '8.2', '8.3' ]
php: [ '8.3' ]
# run static checks only with latest TYPO3 version
minMax: [ 'composerInstallMax' ]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Composer
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s ${{ matrix.minMax }}

- name: Composer validate
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate

- name: cgl
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s cgl -v -n

- name: Lint PHP
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lint
12 changes: 5 additions & 7 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# TYPO3 core test runner based on docker and docker-compose.
#

PHP_VERSION="8.1"
PHP_VERSION="8.3"

# Function to write a .env file in Build/testing-docker/local
# This is read by docker-compose and vars defined here are
Expand Down Expand Up @@ -80,12 +80,11 @@ Options:
- postgres: use postgres
- sqlite: use sqlite
-p <7.4|8.0|8.1|8.2>
-p <8.1|8.2|8.3>
Specifies the PHP minor version to be used
- 7.4: use PHP 7.4
- 8.0: use PHP 8.0
- 8.1: use PHP 8.1
- 8.2: (default) use PHP 8.2
- 8.2: use PHP 8.2
- 8.3: (default) use PHP 8.3
-e "<phpunit options>"
Only with -s functional|unit|phpstan
Expand Down Expand Up @@ -176,7 +175,7 @@ while getopts ":s:d:p:e:xy:huvn" OPT; do
;;
p)
PHP_VERSION=${OPTARG}
if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2)$ ]]; then
if ! [[ ${PHP_VERSION} =~ ^(8.1|8.2|8.3)$ ]]; then
INVALID_OPTIONS+=("${OPT} ${OPTARG} : unsupported php version")
fi
;;
Expand Down Expand Up @@ -222,7 +221,6 @@ if [ ${#INVALID_OPTIONS[@]} -ne 0 ]; then
exit 1
fi

# Move "7.2" to "php72", the latter is the docker container name
DOCKER_PHP_IMAGE=`echo "php${PHP_VERSION}" | sed -e 's/\.//'`

# Set $1 to first mass argument, this is the optional test file or test directory to execute
Expand Down
3 changes: 1 addition & 2 deletions Classes/Xclass/PageLayoutControllerWithCallouts.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ protected function generateMessagesForCurrentPage(ServerRequestInterface $reques
['Sypets/PageCallouts/Xclass/PageLayoutControllerWithCallouts']
['addFlashMessageToPageModule'] ?? []
as $className
)
{
) {
$hook = GeneralUtility::makeInstance($className);
$result = $hook->addMessages($this->pageinfo);
if ($result && is_array($result)) {
Expand Down

0 comments on commit 98ec2fc

Please sign in to comment.