Skip to content

Commit 00a185f

Browse files
authored
* [TASK] Setup github actions
1 parent 3c8bc82 commit 00a185f

File tree

8 files changed

+79
-21
lines changed

8 files changed

+79
-21
lines changed

.gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
/.github export-ignore
12
/.gitattributes export-ignore
23
/.editorconfig export-ignore
4+
/.ecrc export-ignore
35
/Tests/ export-ignore
4-
/.travis.yml export-ignore

.github/workflows/tests.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Source code linting
8+
runs-on: ubuntu-latest
9+
steps:
10+
-
11+
uses: actions/checkout@v2
12+
13+
-
14+
name: Validate composer.json
15+
run: composer validate
16+
17+
-
18+
name: Cache composer dependencies
19+
uses: actions/cache@v1
20+
with:
21+
path: ~/.composer/cache
22+
key: composer
23+
24+
-
25+
name: Install composer dependencies
26+
run: composer install --prefer-dist --no-progress --no-suggest
27+
28+
-
29+
name: PHP Linting
30+
run: composer lint:php
31+
32+
-
33+
name: Editorconfig Linting
34+
run: composer lint:editorconfig
35+
36+
37+
test:
38+
runs-on: ubuntu-latest
39+
40+
strategy:
41+
max-parallel: 2
42+
matrix:
43+
php-versions: [7.4, 7.3, 7.2]
44+
typo3-versions: [10.4, 9.5]
45+
46+
name: PHP ${{ matrix.php-versions }} with TYPO3 ${{ matrix.typo3-versions }}
47+
steps:
48+
-
49+
uses: actions/checkout@v2
50+
51+
-
52+
name: Setup PHP
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php-versions }}
56+
extensions: intl, mbstring, pdo_sqlite
57+
58+
-
59+
name: Cache composer dependencies
60+
uses: actions/cache@v1
61+
with:
62+
path: ~/.composer/cache
63+
key: php-${{ matrix.php-versions }}-typo3-${{ matrix.typo3-versions }}
64+
65+
-
66+
name: Install composer dependencies
67+
run: composer require typo3/minimal "^${{ matrix.typo3-versions }}" --prefer-dist --no-progress --no-suggest
68+
69+
-
70+
name: Automated Testing
71+
run: composer test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.Build
22
composer.lock
3+
/var

.travis.yml

-14
This file was deleted.

Classes/Fluid/ViewHelper/ComponentRenderer.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ protected function initializeComponentParams()
392392
if ($param['type'] === 'boolean' || $param['type'] === 'bool') {
393393
$param['default'] = BooleanNode::convertToBoolean($param['default'], $renderingContext);
394394
// Make sure that default value for object parameters is either a valid object or null
395-
} elseif (
396-
class_exists($param['type']) &&
395+
} elseif (class_exists($param['type']) &&
397396
!$param['default'] instanceof $param['type'] &&
398397
!$componentArgumentConverter->canTypeBeConvertedToType(gettype($param['default']), $param['type'])
399398
) {

Tests/Unit/ComponentLoaderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class ComponentLoaderTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
88
{
9-
protected function setUp()
9+
protected function setUp(): void
1010
{
1111
parent::setUp();
1212

Tests/Unit/XsdGeneratorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class XsdGeneratorTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
1414
protected $fluidNamespaces = null;
1515
protected $componentLoader = null;
1616

17-
protected function setUp()
17+
protected function setUp(): void
1818
{
1919
parent::setUp();
2020

@@ -74,7 +74,7 @@ public function getDefaultPrefixForNamespace() {
7474

7575
}
7676

77-
public function tearDown()
77+
public function tearDown(): void
7878
{
7979
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces'] = $this->fluidNamespaces;
8080
parent::tearDown();

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"typo3fluid/fluid": "^2"
2121
},
2222
"require-dev": {
23-
"typo3/testing-framework": "^4.0",
23+
"typo3/testing-framework": "^4.0 || ^6.0",
2424
"squizlabs/php_codesniffer": "^3.0",
2525
"editorconfig-checker/editorconfig-checker": "^10.0"
2626
},

0 commit comments

Comments
 (0)