-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Use custom composer.json for build
Refs #62
- Loading branch information
Showing
15 changed files
with
184 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "derhansen/sf_yubikey_build", | ||
"description": "composer.json for builds", | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../" | ||
} | ||
], | ||
"require": { | ||
"derhansen/sf_yubikey": "@dev", | ||
"typo3/cms-core": "^12.4", | ||
"php": ">=8.1" | ||
}, | ||
"require-dev": { | ||
"typo3/cms-composer-installers": "^5.0", | ||
"typo3/cms-backend": "^12.4", | ||
"typo3/cms-frontend": "^12.4", | ||
"typo3/cms-extbase": "^12.4", | ||
"typo3/cms-felogin": "^12.4", | ||
"typo3/cms-fluid-styled-content": "^12.4", | ||
"typo3/cms-fluid": "^12.4", | ||
"typo3/cms-tstemplate": "^12.4", | ||
"typo3/cms-install": "^12.4", | ||
"typo3/cms-extensionmanager": "^12.4", | ||
"typo3/testing-framework": "^8.0", | ||
"friendsofphp/php-cs-fixer": "^3.12.0", | ||
"saschaegerer/phpstan-typo3": "^1.8.3", | ||
"phpstan/extension-installer": "^1.1" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"typo3/class-alias-loader": true, | ||
"typo3/cms-composer-installers": true, | ||
"phpstan/extension-installer": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
$header = <<<'EOF' | ||
This file is part of the TYPO3 extension sf_yubikey. | ||
(c) Torben Hansen <[email protected]> | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
return (new \PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@DoctrineAnnotation' => true, | ||
'@PER' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'cast_spaces' => ['space' => 'none'], | ||
'concat_space' => ['spacing' => 'one'], | ||
'declare_equal_normalize' => ['space' => 'none'], | ||
'declare_parentheses' => true, | ||
'dir_constant' => true, | ||
'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']], | ||
'list_syntax' => ['syntax' => 'short'], | ||
'type_declaration_spaces' => true, | ||
'modernize_strpos' => true, | ||
'modernize_types_casting' => true, | ||
'native_function_casing' => true, | ||
'no_alias_functions' => true, | ||
'no_blank_lines_after_phpdoc' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_empty_statement' => true, | ||
'no_extra_blank_lines' => true, | ||
'no_leading_namespace_whitespace' => true, | ||
'no_null_property_initialization' => true, | ||
'no_short_bool_cast' => true, | ||
'no_singleline_whitespace_before_semicolons' => true, | ||
'no_superfluous_elseif' => true, | ||
'no_trailing_comma_in_singleline' => true, | ||
'no_unneeded_control_parentheses' => true, | ||
'no_unused_imports' => true, | ||
'no_useless_else' => true, | ||
'no_useless_nullsafe_operator' => true, | ||
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], | ||
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']], | ||
'php_unit_mock_short_will_return' => true, | ||
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], | ||
'phpdoc_no_access' => true, | ||
'phpdoc_no_empty_return' => true, | ||
'phpdoc_no_package' => true, | ||
'phpdoc_scalar' => true, | ||
'phpdoc_trim' => true, | ||
'phpdoc_types' => true, | ||
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], | ||
'return_type_declaration' => ['space_before' => 'none'], | ||
'single_quote' => true, | ||
'single_space_around_construct' => true, | ||
'single_line_comment_style' => ['comment_types' => ['hash']], | ||
'trailing_comma_in_multiline' => ['elements' => ['arrays']], | ||
'single_line_empty_body' => false, | ||
'whitespace_after_comma_in_array' => ['ensure_single_space' => true], | ||
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(dirname(__DIR__ . '/../../../')) | ||
->exclude(['.Build', 'Documentation', 'Resources']) | ||
->notName('ext_emconf.php') | ||
); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" | ||
backupGlobals="true" | ||
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php" | ||
cacheResult="false" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
beStrictAboutTestsThatDoNotTestAnything="false" | ||
failOnWarning="true" | ||
failOnRisky="true" | ||
cacheDirectory=".phpunit.cache" | ||
requireCoverageMetadata="false" | ||
> | ||
<coverage/> | ||
<testsuites> | ||
<testsuite name="Unit Tests"> | ||
<directory>../../Tests/Unit/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./Classes</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,47 @@ | ||
name: CI | ||
name: Unit- and functional tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
env: | ||
- { php: 8.1, coverage: 0} | ||
- { php: 8.2, coverage: 0} | ||
|
||
env: ${{ matrix.env }} | ||
php: ['8.1', '8.2', '8.3'] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up PHP Version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.env.php }} | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
# Directory permissions for .composer are wrong, so we remove the complete directory | ||
# https://github.com/actions/virtual-environments/issues/824 | ||
- name: Delete .composer directory | ||
run: | | ||
sudo rm -rf ~/.composer | ||
- name: Validate composer.json | ||
run: | | ||
cd .Build | ||
composer validate | ||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.composer/cache | ||
key: dependencies-composer-${{ hashFiles('composer.json') }} | ||
|
||
- name: Install composer dependencies | ||
run: | | ||
cd .Build | ||
composer install --no-progress | ||
- name: Unit Tests | ||
- name: Unit tests | ||
run: | | ||
.Build/bin/phpunit | ||
echo "Running unit tests"; | ||
.Build/vendor/bin/phpunit -c .Build/phpunit/UnitTests.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# PHP Storm, other java IDE's | ||
.idea | ||
atlassian-ide-plugin.xml | ||
.Build | ||
.Build/public | ||
.Build/vendor | ||
.Build/var/ | ||
composer.lock | ||
.phplint.cache | ||
.phpunit.result.cache | ||
.php-cs-fixer.cache | ||
var/ | ||
.phpunit.cache |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.