Skip to content

Commit 19cc0b8

Browse files
committed
Migrate to Forgejo
* Migrate `.github` to `.forgejo`. * Migrate rst to md for proper rendering. * Remove MYSql service dependency from CI, use sqlite instead. That way we have less dependencies.
1 parent e69f498 commit 19cc0b8

3 files changed

Lines changed: 147 additions & 186 deletions

File tree

.forgejo/workflows/ci.yaml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: 'CI'
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
9+
jobs:
10+
check-composer:
11+
runs-on: 'self-hosted'
12+
steps:
13+
- uses: 'actions/checkout@v5'
14+
15+
- name: 'Install PHP'
16+
uses: 'actions/setup-php@v2'
17+
with:
18+
php-version: '8.4'
19+
20+
- name: 'Validate composer.json'
21+
run: 'composer validate'
22+
23+
php-linting:
24+
runs-on: 'self-hosted'
25+
strategy:
26+
matrix:
27+
php-version:
28+
- '8.2'
29+
- '8.3'
30+
- '8.4'
31+
steps:
32+
- name: 'Checkout'
33+
uses: 'actions/checkout@v5'
34+
35+
- name: 'Install PHP'
36+
uses: 'actions/setup-php@v2'
37+
with:
38+
php-version: '${{ matrix.php-version }}'
39+
40+
- name: 'PHP lint'
41+
run: "find .*.php Classes Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"
42+
43+
xml-linting:
44+
runs-on: 'self-hosted'
45+
needs:
46+
- 'check-composer'
47+
steps:
48+
- uses: 'actions/checkout@v5'
49+
50+
- name: 'Install PHP'
51+
uses: 'actions/setup-php@v2'
52+
with:
53+
php-version: '8.4'
54+
55+
- name: 'Install xmllint'
56+
run: 'sudo apt update && sudo apt install libxml2-utils'
57+
58+
- name: 'Install dependencies'
59+
run: 'composer update --prefer-dist --no-progress'
60+
61+
- name: 'PHPUnit configuration file'
62+
run: 'xmllint --schema vendor/phpunit/phpunit/phpunit.xsd --noout phpunit.xml.dist'
63+
64+
coding-guideline:
65+
runs-on: 'self-hosted'
66+
steps:
67+
- uses: 'actions/checkout@v5'
68+
69+
- name: 'Install PHP'
70+
uses: 'actions/setup-php@v2'
71+
with:
72+
php-version: '8.3'
73+
74+
- name: 'Install dependencies'
75+
run: 'composer update --prefer-dist --no-progress'
76+
77+
- name: 'Coding Guideline'
78+
run: './vendor/bin/php-cs-fixer fix --dry-run --diff'
79+
80+
tests:
81+
runs-on: 'self-hosted'
82+
needs:
83+
- 'xml-linting'
84+
strategy:
85+
matrix:
86+
include:
87+
- php-version: '8.2'
88+
typo3-version: '^13.0'
89+
- php-version: '8.3'
90+
typo3-version: '^13.0'
91+
- php-version: '8.4'
92+
typo3-version: '^13.0'
93+
steps:
94+
- uses: 'actions/checkout@v5'
95+
96+
- name: 'Install PHP'
97+
uses: 'actions/setup-php@v2'
98+
with:
99+
php-version: '${{ matrix.php-version }}'
100+
extensions: 'sqlite3'
101+
102+
- name: 'Install dependencies with expected TYPO3 version'
103+
run: 'composer require --prefer-dist --no-progress "typo3/cms-core:${{ matrix.typo3-version }}"'
104+
105+
- name: 'PHPUnit Tests'
106+
run: './vendor/bin/phpunit --testdox'
107+
108+
code-quality:
109+
runs-on: 'self-hosted'
110+
strategy:
111+
matrix:
112+
include:
113+
- php-version: '8.2'
114+
typo3-version: '^13.4'
115+
- php-version: '8.3'
116+
typo3-version: '^13.4'
117+
- php-version: '8.4'
118+
typo3-version: '^13.4'
119+
steps:
120+
- uses: 'actions/checkout@v5'
121+
122+
- name: 'Install PHP'
123+
uses: 'actions/setup-php@v2'
124+
with:
125+
php-version: '${{ matrix.php-version }}'
126+
127+
- name: 'Install dependencies with expected TYPO3 version'
128+
run: 'composer require --prefer-dist --no-progress "typo3/cms-backend:${{ matrix.typo3-version }}" "typo3/cms-core:${{ matrix.typo3-version }}" "typo3/cms-dashboard:${{ matrix.typo3-version }}"'
129+
130+
- name: 'Code Quality (by PHPStan)'
131+
run: './vendor/bin/phpstan analyse'

.github/workflows/ci.yaml

Lines changed: 0 additions & 173 deletions
This file was deleted.

README.rst renamed to README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ We don't like the approach of TYPO3 Testing Framework regarding DataSets.
1010

1111
We have the following issues:
1212

13-
#. XML is only supported for imports, not for assertions
13+
1. XML is only supported for imports, not for assertions
1414

15-
#. CSV is a bad format that already got hacked, e.g. ``#`` to indicate comments.
15+
2. CSV is a bad format that already got hacked, e.g. ``#`` to indicate comments.
1616
We consider it bad as one needs special toolings in order to properly write CSV files, they are not human readable.
1717

1818
That's why we prefer PHP files instead. That way developers are free to use whatever
@@ -34,13 +34,12 @@ See our own tests for how to use, as they do nothing else.
3434
Within testing framework
3535
------------------------
3636

37-
#. Create data set
37+
1. Create data set
3838

3939
A data set is a PHP file that returns an array of tables with their records.
4040
Format is:
4141

42-
.. code-block:: php
43-
42+
```php
4443
return [
4544
'table_name' => [
4645
// Records
@@ -50,11 +49,11 @@ Within testing framework
5049
],
5150
],
5251
];
52+
```
5353

54-
#. Import the :php:`Codappix\Typo3PhpDatasets\TestingFramework` trait
55-
56-
.. code-block:: php
54+
2. Import the :php:`Codappix\Typo3PhpDatasets\TestingFramework` trait
5755

56+
```php
5857
use Codappix\Typo3PhpDatasets\TestingFramework as PhpDatasets;
5958

6059
final class MyTest extends FunctionalTestCase
@@ -63,20 +62,24 @@ Within testing framework
6362

6463
// ...
6564
}
65+
```
6666

67-
#. Use API
67+
3. Use API
6868

6969
Import:
7070

71-
.. code-block:: php
71+
```php
7272

7373
$this->importPHPDataSet(__DIR__ . '/Fixtures/SimpleSet.php');
7474

75+
```
76+
7577
Assert:
7678

77-
.. code-block:: php
79+
```php
7880

7981
$this->assertPHPDataSet(__DIR__ . '/Fixtures/SimpleSet.php');
82+
```
8083

8184
Converter
8285
=========
@@ -88,11 +91,11 @@ Available commands:
8891
- ``convert-from-xml``
8992
- ``convert-from-csv``
9093

91-
Each command will convert the existing file(s) and place a new php variant next to it.
94+
Each command will convert the existing file(s) and place a new PHP variant next to it.
9295
Existing files are only read, not changed.
9396

9497
TODO
9598
====
9699

97-
#. Implement use case to check for necessary updates and allow updates.
100+
1. Implement use case to check for necessary updates and allow updates.
98101
Use for static data during deployment within update wizards or other scripts.

0 commit comments

Comments
 (0)