Commit edebb63e authored by Jan Helke's avatar Jan Helke

[TASK] Enable CI

Ensure that gitlab runs all availiable tests on each commit.
parent 70c89629
Pipeline #57039098 passed with stage
in 2 minutes and 26 seconds
cache:
key: "$CI_BUILD_REF_NAME-$CI_BUILD_STAGE"
paths:
- .composer/
- .php_cs.cache
variables:
COMPOSER_CACHE_DIR: ".composer"
COMPOSER_PROCESS_TIMEOUT: "1800"
COMPOSER_ALLOW_SUPERUSER: "1"
TYPO3_PATH_WEB: "$CI_PROJECT_DIR/.Build/Web"
TYPO3_VERSION: ^9
MYSQL_DATABASE: "typo3"
MYSQL_ROOT_PASSWORD: "joh316"
typo3DatabaseName: "typo3"
typo3DatabaseHost: "mysql"
typo3DatabaseUsername: "root"
typo3DatabasePassword: "joh316"
cgl:
image: composer
stage: test
before_script:
- composer require typo3/minimal="${TYPO3_VERSION}"
- composer install
script:
- .Build/bin/php-cs-fixer fix --config=Build/.php_cs.php -v --dry-run --using-cache=no --path-mode=intersection `git diff --name-only --diff-filter=ACMRTUXB $COMMIT_RANGE`
typo3_8lts_php70:
variables:
TYPO3_VERSION: ^8
image: php:7.0-alpine
stage: test
services:
- mysql:5
before_script:
- apk --no-cache add bash curl git mercurial openssh openssl parallel subversion tini
- docker-php-ext-install mysqli
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- composer require typo3/cms="${TYPO3_VERSION}"
script:
- .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/
typo3_8lts_php71:
variables:
TYPO3_VERSION: ^8
image: php:7.1-alpine
stage: test
services:
- mysql:5
before_script:
- apk --no-cache add bash curl git mercurial openssh openssl parallel subversion tini
- docker-php-ext-install mysqli
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- composer require typo3/cms="${TYPO3_VERSION}"
script:
- .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/
typo3_8lts_php72:
variables:
TYPO3_VERSION: ^8
image: php:7.2-alpine
stage: test
services:
- mysql:5
before_script:
- apk --no-cache add bash curl git mercurial openssh openssl parallel subversion tini
- docker-php-ext-install mysqli
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- composer require typo3/cms="${TYPO3_VERSION}"
script:
- .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/
typo3_8lts_php73:
variables:
TYPO3_VERSION: ^8
image: php:7.3-alpine
stage: test
services:
- mysql:5
before_script:
- apk --no-cache add bash curl git mercurial openssh openssl parallel subversion tini
- docker-php-ext-install mysqli
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- composer require typo3/cms="${TYPO3_VERSION}"
script:
- .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/
typo3_9lts_php72:
variables:
TYPO3_VERSION: ^9
image: php:7.2-alpine
stage: test
services:
- mysql:5
before_script:
- apk --no-cache add bash curl git mercurial openssh openssl parallel subversion tini
- docker-php-ext-install mysqli
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- composer require typo3/minimal="${TYPO3_VERSION}"
script:
- .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/
typo3_9lts_php73:
variables:
TYPO3_VERSION: ^9
image: php:7.3-alpine
stage: test
services:
- mysql:5
before_script:
- apk --no-cache add bash curl git mercurial openssh openssl parallel subversion tini
- docker-php-ext-install mysqli
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- composer require typo3/minimal="${TYPO3_VERSION}"
script:
- .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/
<?php
/**
* This file represents the configuration for Code Sniffing PSR-2-related
* automatic checks of coding guidelines
* Install @fabpot's great php-cs-fixer tool via
*
* $ composer global require friendsofphp/php-cs-fixer
*
* And then simply run
*
* $ php-cs-fixer fix --config ../Build/.php_cs
*
* inside the TYPO3 directory. Warning: This may take up to 10 minutes.
*
* For more information read:
* https://www.php-fig.org/psr/psr-2/
* https://cs.sensiolabs.org
*/
if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}
// Define in which folders to search and which folders to exclude
// Exclude some directories that are excluded by Git anyways to speed up the sniffing
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/../');
// Return a Code Sniffing configuration using
// all sniffers needed for PSR-2
// and additionally:
// - Remove leading slashes in use clauses.
// - PHP single-line arrays should not have trailing comma.
// - Single-line whitespace before closing semicolon are prohibited.
// - Remove unused use statements in the PHP source code
// - Ensure Concatenation to have at least one whitespace around
// - Remove trailing whitespace at the end of blank lines.
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@DoctrineAnnotation' => true,
'no_leading_import_slash' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_unused_imports' => true,
'concat_space' => ['spacing' => 'one'],
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'single_quote' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'no_blank_lines_after_phpdoc' => true,
'array_syntax' => ['syntax' => 'short'],
'whitespace_after_comma_in_array' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'no_alias_functions' => true,
'lowercase_cast' => true,
'no_leading_namespace_whitespace' => true,
'native_function_casing' => true,
'no_short_bool_cast' => true,
'no_unneeded_control_parentheses' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_trim' => true,
'no_superfluous_elseif' => true,
'no_useless_else' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'return_type_declaration' => ['space_before' => 'none'],
'cast_spaces' => ['space' => 'none'],
'declare_equal_normalize' => ['space' => 'single'],
'dir_constant' => true,
'phpdoc_no_access' => true
])
->setFinder($finder);
......@@ -21,6 +21,11 @@
"typo3/cms-core": "^8.7.13 || ^9.5.0",
"sjbr/static-info-tables": "^6.7"
},
"require-dev": {
"editorconfig-checker/editorconfig-checker": "^8.0",
"friendsofphp/php-cs-fixer": "^2.13",
"typo3/testing-framework": "^1 || ^4 || ^5"
},
"suggest": {
"friendsoftypo3/typo3db-legacy": "^1.1"
},
......@@ -38,6 +43,16 @@
"cal": "self.version",
"typo3-ter/cal": "self.version"
},
"config": {
"vendor-dir": ".Build/vendor",
"bin-dir": ".Build/bin"
},
"scripts": {
"post-autoload-dump": [
"mkdir -p .Build/Web/typo3conf/ext/",
"[ -L .Build/Web/typo3conf/ext/cal ] || ln -snvf ../../../../. .Build/Web/typo3conf/ext/cal"
]
},
"extra": {
"typo3/cms": {
"extension-key": "cal"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment