Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ phpstan-baseline.neon export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
.php-cs-fixer.dist.php export-ignore
.yamllint.yaml export-ignore
192 changes: 60 additions & 132 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,106 +1,61 @@
name: CI
name: 'CI'

on:
'on':
push:
branches:
- main
- 'main'
pull_request:

jobs:
check-composer:
runs-on: ubuntu-latest
base-qa:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
- uses: 'actions/checkout@v4'

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
coverage: none
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate composer.json
run: composer validate
- name: 'Install yamllint'
run: 'sudo apt update && sudo apt install yamllint'

php-linting:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 8.1
- 8.2
- 8.3
- 8.4
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 'Lint yaml files'
run: 'yamllint .'

- name: Install PHP
uses: shivammathur/setup-php@v2
- name: 'Install PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: "${{ matrix.php-version }}"
coverage: none

- name: PHP lint
run: "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"

xml-linting:
runs-on: ubuntu-latest
needs:
- check-composer
steps:
- uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
coverage: none
tools: composer:v2
php-version: '8.5'
coverage: 'none'
tools: 'composer:v2'
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install xmllint
run: sudo apt update && sudo apt install libxml2-utils
COMPOSER_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: 'Validate composer.json'
run: 'composer validate'

- name: PHPUnit configuration file
run: xmllint --schema vendor/phpunit/phpunit/phpunit.xsd --noout phpunit.xml.dist
- name: 'Install xmllint'
run: 'sudo apt update && sudo apt install libxml2-utils'

- name: Fetch schema for xliff
run: wget https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd --output-document=.Build/xliff-core-1.2-strict.xsd
- name: 'Create .Build dir for xsd download'
run: 'mkdir .Build/'

- name: TYPO3 language files
run: xmllint --schema .Build/xliff-core-1.2-strict.xsd --noout $(find Resources -name '*.xlf')
- name: 'Fetch schema for xliff'
run: 'wget https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd --output-document=.Build/xliff-core-1.2-strict.xsd'

coding-guideline:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Lint TYPO3 language files'
run: |
xmllint --schema .Build/xliff-core-1.2-strict.xsd --noout $(find Resources -name '*.xlf')

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
coverage: none
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Install dependencies'
run: 'composer install --prefer-dist --no-progress'

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: 'PHPUnit configuration file'
run: 'xmllint --schema vendor/phpunit/phpunit/phpunit.xsd --noout phpunit.xml.dist'

- name: Coding Guideline
run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run --diff
- name: 'Coding Guideline'
run: './vendor/bin/php-cs-fixer fix --dry-run --diff'

tests-mysql:
runs-on: ubuntu-latest
advanced-qa:
runs-on: 'ubuntu-latest'
needs:
- xml-linting
- 'base-qa'
strategy:
matrix:
include:
Expand All @@ -125,76 +80,49 @@ jobs:
- db-version: '8'
php-version: '8.4'
typo3-version: '^13.4'
- db-version: '8'
php-version: '8.5'
typo3-version: '^13.4'
steps:
- uses: actions/checkout@v4
- uses: 'actions/checkout@v4'

- name: Install PHP
uses: shivammathur/setup-php@v2
- name: 'Install PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: "${{ matrix.php-version }}"
coverage: none
tools: composer:v2
php-version: '${{ matrix.php-version }}'
coverage: 'none'
tools: 'composer:v2'
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPOSER_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: 'PHP lint'
run: |
find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

- name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
- name: 'Install dependencies with expected TYPO3 version'
run: 'composer require --prefer-dist --no-progress "typo3/cms-core:${{ matrix.typo3-version }}"'

- name: 'Code Quality (by PHPStan)'
run: './vendor/bin/phpstan analyse'

- name: 'Setup MySQL'
uses: 'mirromutth/mysql-action@v1.1'
with:
mysql version: '${{ matrix.db-version }}'
mysql database: 'typo3'
mysql root password: 'root'

- name: Wait for MySQL
- name: 'Wait for MySQL'
run: |
while ! mysqladmin ping --host=127.0.0.1 --password=root --silent; do
sleep 1
done

- name: Install dependencies with expected TYPO3 version
run: composer require --prefer-dist --no-progress "typo3/cms-core:${{ matrix.typo3-version }}"

- name: PHPUnit Tests
- name: 'PHPUnit Tests'
run: |-
export typo3DatabaseDriver="pdo_mysql"
export typo3DatabaseName="typo3"
export typo3DatabaseHost="127.0.0.1"
export typo3DatabaseUsername="root"
export typo3DatabasePassword="root"
./vendor/bin/phpunit --testdox

code-quality:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: '8.1'
typo3-version: '^12.4'
- php-version: '8.2'
typo3-version: '^12.4'
- php-version: '8.3'
typo3-version: '^12.4'
- php-version: '8.4'
typo3-version: '^12.4'
- php-version: '8.2'
typo3-version: '^13.4'
- php-version: '8.3'
typo3-version: '^13.4'
- php-version: '8.4'
typo3-version: '^13.4'
steps:
- uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies with expected TYPO3 version
run: composer require --prefer-dist --no-progress "typo3/cms-core:${{ matrix.typo3-version }}"

- name: Code Quality (by PHPStan)
run: ./vendor/bin/phpstan analyse
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ function transform(string $className): string

return (new Config())
->setRiskyAllowed(true)
->setUnsupportedPhpVersionAllowed(true)
->setFinder(
(new Finder())
->ignoreVCSIgnored(true)
Expand Down
43 changes: 43 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
extends: 'default'

yaml-files:
- '*.yaml'

ignore:
- 'vendor/'
- '.Build/'

rules:
braces:
min-spaces-inside: 1
max-spaces-inside: 1
min-spaces-inside-empty: 1
max-spaces-inside-empty: 1
level: 'error'
brackets:
min-spaces-inside: 1
max-spaces-inside: 1
min-spaces-inside-empty: 1
max-spaces-inside-empty: 1
level: 'error'
document-start:
present: false
level: 'error'
line-length: 'disable'
empty-values: 'disable'
indentation:
spaces: 2
indent-sequences: true
level: 'error'
empty-lines:
max: 1
level: 'error'
quoted-strings:
quote-type: 'any'
level: 'error'
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
level: 'error'
truthy:
level: 'error'
4 changes: 2 additions & 2 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
imports:
- { resource: Backend/DashboardWidgets.yaml }
- { resource: 'Backend/DashboardWidgets.yaml' }

services:
_defaults:
Expand Down Expand Up @@ -69,7 +69,7 @@ services:
DanielSiepmann\Tracking\Middleware\Recordview:
public: true
arguments:
$rules: []
$rules: [ ]

DanielSiepmann\Tracking\EventListener\ExcludeFromReferenceIndex:
tags:
Expand Down
27 changes: 27 additions & 0 deletions Documentation/Changelog/3.2.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
3.2.0
=====

Breaking
--------

Nothing

Features
--------

* Add PHP 8.5 support.

Fixes
-----

Nothing

Tasks
-----

Nothing

Deprecation
-----------

Nothing
18 changes: 9 additions & 9 deletions Tests/Functional/Fixtures/sites/example/config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
base: '/'
languages:
-
title: English
title: 'English'
enabled: true
languageId: '0'
base: /
typo3Language: default
locale: en_US.utf8
iso-639-1: en
navigationTitle: English
hreflang: en-us
direction: ltr
flag: us
base: '/'
typo3Language: 'default'
locale: 'en_US.utf8'
iso-639-1: 'en'
navigationTitle: 'English'
hreflang: 'en-us'
direction: 'ltr'
flag: 'us'
websiteTitle: ''
rootPageId: 1
10 changes: 5 additions & 5 deletions Tests/Functional/PageviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ public function preventsTrackingOfUserAgents(string $userAgent): void
self::assertCount(0, $this->getAllRecords('tx_tracking_pageview'));
}

public static function possibleDeniedUserAgents(): array
public static function possibleDeniedUserAgents(): iterable
{
return [
'Uptime-Kuma' => [
'userAgent' => 'Uptime-Kuma/1.21.2',
],

yield 'Uptime-Kuma' => [
'userAgent' => 'Uptime-Kuma/1.21.2',
];

}
}
Loading