Skip to content

Commit 8bcc33f

Browse files
committed
[TASK] sync the CI stuff from main branch into 11.6.x
Relates: #3781
1 parent 2a5ba8f commit 8bcc33f

File tree

12 files changed

+144
-159
lines changed

12 files changed

+144
-159
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Used versions (please complete the following information):**
27-
- TYPO3 Version: [e.g. 11.5.26]
27+
- TYPO3 Version: [e.g. 12.4.0]
2828
- Browser: [e.g. chrome, safari]
2929
- EXT:solr Version: [e.g. 12.0.0]
3030
- Used Apache Solr Version: [e.g. 9.3.1]

.github/workflows/ci.yml

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@ jobs:
2323
outputs:
2424
matrix: ${{ steps.collect_build_matrix.outputs.matrix }}
2525
steps:
26-
# Workaround for issue with actions/checkout@v2 wrong PR commit checkout: See https://github.com/actions/checkout/issues/299#issuecomment-677674415
26+
# Workaround for issue with actions/checkout "wrong PR commit checkout":
27+
# See:
28+
# ** https://github.com/actions/checkout/issues/299#issuecomment-677674415
29+
# ** https://github.com/actions/checkout/issues/1359#issuecomment-1631503791
2730
-
2831
name: Checkout current state of Pull Request
2932
if: github.event_name == 'pull_request'
30-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
3134
with:
3235
ref: ${{ github.event.pull_request.head.sha }}
3336
-
3437
name: Checkout current state of Branch
3538
if: github.event_name == 'push'
36-
uses: actions/checkout@v2
37-
# End: Workaround for issue with actions/checkout@v2 wrong PR commit checkout
39+
uses: actions/checkout@v3
40+
# End: Workaround for issue with actions/checkout...
3841
-
3942
name: "Resolve target branch of pull request."
4043
if: github.event_name == 'pull_request'
@@ -69,10 +72,10 @@ jobs:
6972
echo "matrix=$(echo $matrix)" >> $GITHUB_OUTPUT
7073
-
7174
name: Set up Docker Buildx
72-
uses: docker/setup-buildx-action@v1
75+
uses: docker/setup-buildx-action@v2
7376
-
7477
name: Build Docker image
75-
uses: docker/build-push-action@v2
78+
uses: docker/build-push-action@v4
7679
with:
7780
context: .
7881
file: ./Docker/SolrServer/Dockerfile
@@ -88,7 +91,7 @@ jobs:
8891
./Build/Test/cibuild_docker.sh
8992
-
9093
name: Upload artifact
91-
uses: actions/upload-artifact@v2
94+
uses: actions/upload-artifact@v3
9295
with:
9396
name: solrci-image
9497
path: /tmp/solrci-image.tar
@@ -104,40 +107,39 @@ jobs:
104107
TYPO3_DATABASE_HOST: '127.0.0.1'
105108
TYPO3_DATABASE_USERNAME: 'root'
106109
TYPO3_DATABASE_PASSWORD: 'root'
107-
PHP_CS_FIXER_VERSION: '^3.2.1'
108110
TYPO3_VERSION: ${{ matrix.TYPO3 }}
109111

110112
name: TYPO3 ${{ matrix.TYPO3 }} on PHP ${{ matrix.PHP }}
111113
steps:
112-
# Workaround for issue with actions/checkout@v2 wrong PR commit checkout: See https://github.com/actions/checkout/issues/299#issuecomment-677674415
114+
# Workaround for issue with actions/checkout "wrong PR commit checkout". See: ci_bootstrapping job
113115
-
114116
name: Checkout current state of Pull Request
115117
if: github.event_name == 'pull_request'
116-
uses: actions/checkout@v2
118+
uses: actions/checkout@v3
117119
with:
118120
fetch-depth: 2
119121
ref: ${{ github.event.pull_request.head.sha }}
120122
-
121123
name: Checkout current state of Branch
122124
if: github.event_name == 'push'
123-
uses: actions/checkout@v2
125+
uses: actions/checkout@v3
124126
with:
125127
fetch-depth: 2
126-
# End: Workaround for issue with actions/checkout@v2 wrong PR commit checkout
128+
# End: Workaround for issue with actions/checkout...
127129
-
128130
name: Mount RAMFS
129131
run: |
130132
mkdir -p ${{ env.CI_BUILD_DIRECTORY }}
131-
sudo mount -t tmpfs -o size=3G none ${{ env.CI_BUILD_DIRECTORY }}
133+
sudo mount -t tmpfs -o size=1G none ${{ env.CI_BUILD_DIRECTORY }}
132134
sudo mkdir -p ${{ env.CI_BUILD_DIRECTORY }}/data-{solr,mysql} \
133135
&& sudo chown $USER ${{ env.CI_BUILD_DIRECTORY }}/data-mysql \
134136
&& sudo chown 8983:8983 ${{ env.CI_BUILD_DIRECTORY }}/data-solr
135137
-
136138
name: Set up Docker Buildx
137-
uses: docker/setup-buildx-action@v1
139+
uses: docker/setup-buildx-action@v2
138140
-
139141
name: Download solrci-image from "ci_bootstrapping" job
140-
uses: actions/download-artifact@v2
142+
uses: actions/download-artifact@v3
141143
with:
142144
name: solrci-image
143145
path: /tmp
@@ -160,36 +162,9 @@ jobs:
160162
with:
161163
php-version: ${{ matrix.PHP }}
162164
coverage: pcov
163-
tools: composer:2.1.14
164-
-
165-
name: Resolve CI build cache key
166-
# CI_CACHE_VERSION is used and can be increased to be able to invalidate caches.
167-
# For example if some composer dependencies added or removed in composer.json or
168-
# in Build/Test/bootstrap.sh
169-
run: |
170-
export CURRENT_TYPO3_VERSION_REFERNCE=$(./Build/Helpers/TYPO3_SOURCE_REFERENCE.sh "$TYPO3_VERSION" --short)
171-
export CURRENT_SOLARIUM_VERSION=$(cat composer.json | jq --raw-output '.require."solarium/solarium"')
172-
export CI_CACHE_VERSION="2023.01.20@00:00"
173-
export CI_BUILD_CACHE_KEY=${{ runner.os }}-PHP:${{ matrix.PHP }}-TYPO3:$TYPO3_VERSION@$CURRENT_TYPO3_VERSION_REFERNCE-SOLARIUM:$CURRENT_SOLARIUM_VERSION-"CI_CACHE_VERSION:"$CI_CACHE_VERSION
174-
echo "COMPOSER_GLOBAL_REQUEREMENTS=$(composer config home)" >> $GITHUB_ENV
175-
echo "CI_BUILD_CACHE_KEY=$CI_BUILD_CACHE_KEY" >> $GITHUB_ENV
176-
echo "The key for actions/cache@v2 is \"$CI_BUILD_CACHE_KEY\""
177-
-
178-
name: Restore ci build caches
179-
id: restore_ci_build_caches
180-
uses: actions/cache@v2
181-
with:
182-
path: |
183-
${{ env.CI_BUILD_DIRECTORY }}/Web
184-
${{ env.CI_BUILD_DIRECTORY }}/bin
185-
${{ env.CI_BUILD_DIRECTORY }}/vendor
186-
${{ env.COMPOSER_GLOBAL_REQUEREMENTS }}
187-
composer.json
188-
composer.lock
189-
key: ${{ env.CI_BUILD_CACHE_KEY }}
165+
tools: composer:2.5.5
190166
-
191167
name: CI-Bootstrap
192-
if: steps.restore_ci_build_caches.outputs.cache-hit != 'true'
193168
run: |
194169
./Build/Test/bootstrap.sh --skip-solr-install
195170
echo "Current Size of EXT:Solr build Artefacts before run: " \
@@ -204,8 +179,8 @@ jobs:
204179
-
205180
name: Upload code coverage to Scrutinizer
206181
run: |
207-
.Build/bin/ocular code-coverage:upload --format=php-clover coverage.unit.clover
208-
.Build/bin/ocular code-coverage:upload --format=php-clover coverage.integration.clover
182+
ocular code-coverage:upload --format=php-clover coverage.unit.clover
183+
ocular code-coverage:upload --format=php-clover coverage.integration.clover
209184
-
210185
name: Clean up
211186
run: |
@@ -225,7 +200,7 @@ jobs:
225200
steps:
226201
-
227202
name: Checkout repository
228-
uses: actions/checkout@v2
203+
uses: actions/checkout@v3
229204
with:
230205
ref: ${{ github.event.pull_request.head.sha }}
231206
-

Build/Test/IntegrationTests.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
33
backupGlobals="false"
4+
bootstrap="IntegrationTestsBootstrap.php"
45
backupStaticAttributes="false"
56
colors="true"
67
convertErrorsToExceptions="true"

Build/Test/IntegrationTestsBootstrap.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
* The TYPO3 project - inspiring people to share!
1414
*/
1515

16-
call_user_func(function () {
17-
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
16+
use TYPO3\TestingFramework\Core\Testbase;
17+
18+
call_user_func(static function () {
19+
$testbase = new Testbase();
1820
$testbase->defineOriginalRootPath();
1921
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests');
2022
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient');

Build/Test/UnitTests.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
33
backupGlobals="false"
4+
bootstrap="UnitTestsBootstrap.php"
45
backupStaticAttributes="false"
56
colors="true"
67
convertErrorsToExceptions="true"

Build/Test/bootstrap.sh

Lines changed: 21 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
#!/usr/bin/env bash
22

3-
if [[ -n ${BASH_SOURCE[0]} ]]; then
4-
SCRIPTPATH=$( cd $(dirname ${BASH_SOURCE[0]}) ; pwd -P )
5-
else
6-
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
7-
fi
8-
9-
EXTENSION_ROOTPATH="$SCRIPTPATH/../../"
10-
SOLR_INSTALL_PATH="/opt/solr-tomcat/"
11-
12-
DEFAULT_TYPO3_VERSION="^11.5.14"
13-
DEFAULT_PHP_CS_FIXER_VERSION="^3.2.1"
3+
DEFAULT_TYPO3_VERSION="11"
144
DEFAULT_TYPO3_DATABASE_HOST="localhost"
155
DEFAULT_TYPO3_DATABASE_NAME="test"
166
DEFAULT_TYPO3_DATABASE_USERNAME="root"
177
DEFAULT_TYPO3_DATABASE_PASSWORD="supersecret"
188

199
if [[ $* == *--use-defaults* ]]; then
2010
export TYPO3_VERSION=$DEFAULT_TYPO3_VERSION
21-
export PHP_CS_FIXER_VERSION=$DEFAULT_PHP_CS_FIXER_VERSION
2211
export TYPO3_DATABASE_HOST=$DEFAULT_TYPO3_DATABASE_HOST
2312
export TYPO3_DATABASE_NAME=$DEFAULT_TYPO3_DATABASE_NAME
2413
export TYPO3_DATABASE_USERNAME=$DEFAULT_TYPO3_DATABASE_USERNAME
@@ -31,11 +20,6 @@ if [[ $* == *--local* ]]; then
3120
if [ -z "$typo3Version" ]; then typo3Version=$DEFAULT_TYPO3_VERSION; fi
3221
export TYPO3_VERSION=$typo3Version
3322

34-
echo -n "Choose a php-cs-fixer version [defaults: " $DEFAULT_PHP_CS_FIXER_VERSION"] : "
35-
read phpCSFixerVersion
36-
if [ -z "$phpCSFixerVersion" ]; then phpCSFixerVersion=$DEFAULT_PHP_CS_FIXER_VERSION; fi
37-
export PHP_CS_FIXER_VERSION=$phpCSFixerVersion
38-
3923
echo -n "Choose a database hostname: [defaults: " $DEFAULT_TYPO3_DATABASE_HOST"] : "
4024
read typo3DbHost
4125
if [ -z "$typo3DbHost" ]; then typo3DbHost=$DEFAULT_TYPO3_DATABASE_HOST; fi
@@ -57,60 +41,41 @@ if [[ $* == *--local* ]]; then
5741
export TYPO3_DATABASE_PASSWORD=$typo3DbPassword
5842
fi
5943

60-
echo "Using TYPO3 Version: $TYPO3_VERSION"
61-
echo "Using PHP-CS Fixer Version: $PHP_CS_FIXER_VERSION"
62-
echo "Using database host: $TYPO3_DATABASE_HOST"
63-
echo "Using database dbname: $TYPO3_DATABASE_NAME"
64-
echo "Using database user: $TYPO3_DATABASE_USERNAME"
65-
echo "Using database password: $TYPO3_DATABASE_PASSWORD"
66-
6744
if [ -z $TYPO3_VERSION ]; then
68-
echo "Must set env var TYPO3_VERSION (e.g. dev-main or ^11.5)"
45+
echo "Must set env var TYPO3_VERSION (e.g. dev-main or ^12.4)"
6946
exit 1
7047
fi
7148

72-
# Use latest TYPO3 LTS stable version, if version number is compatible with get.typo3.org API
73-
if [[ $TYPO3_VERSION =~ ^[0-9]+$ ]] ; then
74-
TYPO3_VERSION=$("${BASH_SOURCE%/*}/../Helpers/TYPO3_GET_LATEST_VERSION.sh" "$TYPO3_VERSION")
75-
fi
76-
7749
if ! wget --version > /dev/null 2>&1
7850
then
7951
echo "Couldn't find wget."
8052
exit 1
8153
fi
8254

83-
COMPOSER_NO_INTERACTION=1
84-
85-
# Setup TYPO3 environment variables
86-
export TYPO3_PATH_PACKAGES="${EXTENSION_ROOTPATH}.Build/vendor/"
87-
export TYPO3_PATH_WEB="${EXTENSION_ROOTPATH}.Build/Web/"
55+
# Use latest TYPO3 LTS stable version, if version number is compatible with get.typo3.org API
56+
if [[ $TYPO3_VERSION =~ ^[0-9]+$ ]] ; then
57+
TYPO3_VERSION=$("${BASH_SOURCE%/*}/../Helpers/TYPO3_GET_LATEST_VERSION.sh" "$TYPO3_VERSION")
58+
fi
8859

89-
echo "Installing test environment"
90-
echo "Using extension path $EXTENSION_ROOTPATH"
91-
echo "Using package path $TYPO3_PATH_PACKAGES"
92-
echo "Using web path $TYPO3_PATH_WEB"
60+
echo "Using TYPO3 Version: $TYPO3_VERSION"
61+
echo "Using database host: $TYPO3_DATABASE_HOST"
62+
echo "Using database dbname: $TYPO3_DATABASE_NAME"
63+
echo "Using database user: $TYPO3_DATABASE_USERNAME"
64+
echo "Using database password: $TYPO3_DATABASE_PASSWORD"
9365

94-
# Install TYPO3 sources
95-
if [[ $TYPO3_VERSION = *"master"* ]]; then
96-
composer config minimum-stability dev
97-
fi
66+
COMPOSER_NO_INTERACTION=1
9867

99-
if ! composer require --dev --update-with-dependencies --prefer-source \
100-
typo3/cms-core:"$TYPO3_VERSION" \
101-
typo3/cms-backend:"$TYPO3_VERSION" \
102-
typo3/cms-recordlist:"$TYPO3_VERSION" \
103-
typo3/cms-fluid:"$TYPO3_VERSION" \
104-
typo3/cms-fluid-styled-content:"$TYPO3_VERSION" \
105-
typo3/cms-frontend:"$TYPO3_VERSION" \
106-
typo3/cms-extbase:"$TYPO3_VERSION" \
107-
typo3/cms-reports:"$TYPO3_VERSION" \
108-
typo3/cms-scheduler:"$TYPO3_VERSION" \
109-
typo3/cms-tstemplate:"$TYPO3_VERSION" \
110-
typo3/cms-install:"$TYPO3_VERSION"
68+
echo "Installing test environment"
69+
if ! composer tests:setup
11170
then
11271
echo "The test environment could not be installed by composer as expected. Please fix this issue."
11372
exit 1
11473
fi
11574

116-
mkdir -p $TYPO3_PATH_WEB/uploads $TYPO3_PATH_WEB/typo3temp
75+
echo "Install third party tools globally:"
76+
export PATH=$PATH:$(composer config --global home)/vendor/bin
77+
if ! composer tests:setup:global-require
78+
then
79+
"The test environment could not be installed by composer as expected. Please fix this issue."
80+
exit 1
81+
fi

0 commit comments

Comments
 (0)