Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Upgrade test suite tea #297

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
}
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "composer install; mkdir rector; cd rector; composer init -n --name local/rector; composer require ssch/typo3-rector -n; cd ..; rector/vendor/bin/rector --version"
"postCreateCommand": "composer install"
}
53 changes: 53 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# JS files
[*.js]
indent_size = 2

# JSON files
[*.json]
indent_style = tab

# package.json
[package.json]
indent_size = 2

# ReST files
[{*.rst,*.rst.txt}]
indent_size = 4
max_line_length = 80

# SQL files
[*.sql]
indent_style = tab
indent_size = 2

# TypoScript files
[*.{typoscript,tsconfig}]
indent_size = 2

# YAML files
[{*.yml,*.yaml}]
indent_size = 2

# XLF files
[*.xlf]
indent_style = tab

# .htaccess
[.htaccess]
indent_style = tab

# Markdown files
[*.md]
max_line_length = 80
43 changes: 32 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,36 @@

version: 2
updates:
# Maintain dependencies for GitHub Actions.
#- package-ecosystem: "github-actions"
# directory: "/"
# schedule:
# interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "[TASK] "

# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: increase-if-necessary
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: "development"
ignore:
- dependency-name: "doctrine/dbal"
- dependency-name: "phpunit/phpunit"
versions: [ "^12.0" ]
- dependency-name: "symfony/console"
- dependency-name: "symfony/translation"
- dependency-name: "symfony/yaml"
- dependency-name: "typo3/cms-*"
- dependency-name: "typo3/coding-standards"
versioning-strategy: "increase"
commit-message:
prefix: "[TASK] "

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: "increase"
commit-message:
prefix: "[TASK] "
273 changes: 273 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
---
# This GitHub Actions workflow uses the same development tools that are also installed locally
# via Composer or PHIVE and calls them using the Composer scripts.
name: CI with Composer scripts
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '15 3 * * 1'
permissions:
contents: read
jobs:
php-lint:
name: "PHP linter"
runs-on: ubuntu-24.04
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
ini-file: development
coverage: none
tools: composer:v2
- name: "Cache dependencies installed with composer"
uses: actions/cache@v4
with:
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php-version }}-composer-\n"
- name: "Install Composer dependencies"
run: "composer update --no-progress"
- name: "Show the Composer configuration"
run: "composer config --global --list"
- name: "Run PHP lint"
run: "composer ci:php:lint"
strategy:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
code-quality:
name: "Code quality checks"
runs-on: ubuntu-24.04
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
ini-file: development
coverage: none
tools: composer:v2
- name: "Show Composer version"
run: "composer --version"
- name: "Show the Composer configuration"
run: "composer config --global --list"
- name: "Cache dependencies installed with composer"
uses: actions/cache@v4
with:
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php-version }}-composer-\n"
- name: "Install Composer dependencies"
run: "composer update --no-progress"
- name: "Run command"
run: "composer ci:${{ matrix.command }}"
strategy:
fail-fast: false
matrix:
command:
- "composer:normalize"
- "composer:psr-verify"
- "composer:unused"
- "json:lint"
- "php:cs-fixer"
- "php:mess"
- "php:sniff"
- "php:stan"
- "typoscript:lint"
- "yaml:lint"
- "xliff:lint"
php-version:
- "8.3"
code-quality-frontend:
name: "Code quality frontend checks"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
command:
- "css"
- "js"
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Set up Node.js"
uses: actions/setup-node@v4
with:
node-version: "22.5.1"
- name: "Install modules"
run: |
npm ci
- name: "Run command"
run: |
npm run ci:lint:${{ matrix.command }}
unit-tests:
name: "Unit tests"
runs-on: ubuntu-24.04
needs: php-lint
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
ini-file: development
coverage: none
tools: composer:v2
- name: "Show Composer version"
run: "composer --version"
- name: "Show the Composer configuration"
run: "composer config --global --list"
- name: "Cache dependencies installed with composer"
uses: actions/cache@v4
with:
key: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-\n"
- name: "Install TYPO3 Core"
env:
TYPO3: "${{ matrix.typo3-version }}"
run: |
composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"$TYPO3"
composer show
- name: "Install lowest dependencies with composer"
if: "matrix.composer-dependencies == 'lowest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
composer show
- name: "Install highest dependencies with composer"
if: "matrix.composer-dependencies == 'highest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies
composer show
- name: "Run unit tests"
run: "composer ci:tests:unit"
strategy:
fail-fast: false
matrix:
include:
- typo3-version: "^12.4"
php-version: "8.1"
composer-dependencies: lowest
- typo3-version: "^12.4"
php-version: "8.1"
composer-dependencies: highest
- typo3-version: "^12.4"
php-version: "8.2"
composer-dependencies: lowest
- typo3-version: "^12.4"
php-version: "8.2"
composer-dependencies: highest
- typo3-version: "^12.4"
php-version: "8.3"
composer-dependencies: lowest
- typo3-version: "^12.4"
php-version: "8.3"
composer-dependencies: highest
functional-tests:
name: "Functional tests"
runs-on: ubuntu-24.04
needs: php-lint
env:
DB_DATABASE: typo3
DB_USER: root
DB_PASSWORD: root
DB_HOST: localhost
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
ini-file: development
tools: composer:v2
extensions: mysqli
coverage: none
- name: "Show Composer version"
run: "composer --version"
- name: "Show the Composer configuration"
run: "composer config --global --list"
- name: "Cache dependencies installed with composer"
uses: actions/cache@v4
with:
key: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-\n"
- name: "Install TYPO3 Core"
env:
TYPO3: "${{ matrix.typo3-version }}"
run: |
composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"$TYPO3"
composer show
- name: "Install lowest dependencies with composer"
if: "matrix.composer-dependencies == 'lowest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
composer show
- name: "Install highest dependencies with composer"
if: "matrix.composer-dependencies == 'highest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies
composer show
- name: "Start MySQL"
run: "sudo /etc/init.d/mysql start"
- name: "Run functional tests"
run: |
export typo3DatabaseName="$DB_DATABASE";
export typo3DatabaseHost="$DB_HOST";
export typo3DatabaseUsername="$DB_USER";
export typo3DatabasePassword="$DB_PASSWORD";
composer ci:tests:functional
strategy:
fail-fast: false
matrix:
include:
- typo3-version: "^12.4"
php-version: "8.1"
composer-dependencies: lowest
- typo3-version: "^12.4"
php-version: "8.1"
composer-dependencies: highest
- typo3-version: "^12.4"
php-version: "8.2"
composer-dependencies: lowest
- typo3-version: "^12.4"
php-version: "8.2"
composer-dependencies: highest
- typo3-version: "^12.4"
php-version: "8.3"
composer-dependencies: lowest
- typo3-version: "^12.4"
php-version: "8.3"
composer-dependencies: highest
shellcheck:
name: Check shell scripts
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check scripts
run: |
Build/Scripts/runTests.sh -s shellcheck
documentation:
name: Documentation
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test if the documentation will render without warnings
run: |
docker run --rm --pull always -v $(pwd):/project \
ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --fail-on-log
Loading
Loading