Skip to content

Commit 3e294c2

Browse files
authored
Merge pull request #31 from netlogix/feature/typo3-v13-update
2 parents 747a13f + 345d43f commit 3e294c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+429
-1262
lines changed

.editorconfig

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,17 @@
33
# top-most EditorConfig file
44
root = true
55

6-
# Unix-style newlines with a newline ending every file
76
[*]
87
charset = utf-8
98
end_of_line = lf
10-
indent_style = space
119
indent_size = 4
10+
indent_style = space
1211
insert_final_newline = true
1312
trim_trailing_whitespace = true
13+
max_line_length = 180
1414

15-
# TS/JS-Files
16-
[*.{ts,js}]
17-
indent_size = 2
18-
19-
# JSON-Files
20-
[*.json]
21-
indent_style = tab
22-
23-
# ReST-Files
24-
[*.{rst,rst.txt}]
25-
indent_size = 4
26-
max_line_length = 80
27-
28-
# Markdown-Files
29-
[*.md]
30-
max_line_length = 80
31-
32-
# YAML-Files
33-
[*.{yaml,yml}]
34-
indent_size = 2
35-
36-
# NEON-Files
37-
[*.neon]
38-
indent_size = 2
39-
indent_style = tab
40-
41-
# package.json
42-
[package.json]
43-
indent_size = 2
44-
45-
# TypoScript
46-
[*.{typoscript,tsconfig}]
47-
indent_size = 2
48-
49-
# XLF-Files
50-
[*.xlf]
51-
indent_style = tab
52-
53-
# SQL-Files
54-
[*.sql]
55-
indent_style = tab
56-
indent_size = 2
57-
58-
# .htaccess
59-
[{_.htaccess,.htaccess}]
60-
indent_style = tab
15+
[*.php]
16+
max_line_length = 115
6117

62-
[*.csv]
63-
insert_final_newline = false
18+
[{*.yml,*.yaml}]
19+
indent_size = 2

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## code changes will send PR to following users
2+
* @saschanowak
3+
* @tweis

.github/workflows/apply-coding-standard.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
php-coding-standard:
1014
name: 'Apply PHP Coding Standard'
@@ -16,7 +20,7 @@ jobs:
1620
- name: 'Setup PHP'
1721
uses: shivammathur/setup-php@v2
1822
with:
19-
php-version: '8.1'
23+
php-version-file: '.phprc'
2024
tools: composer
2125

2226
- name: 'Get Composer Cache Directory'
@@ -37,25 +41,35 @@ jobs:
3741

3842
- name: 'Rector PHP Code'
3943
shell: bash
40-
run: composer rector-fix
44+
run: composer rector:fix
45+
46+
- name: 'Normalize Composer files'
47+
shell: bash
48+
run: composer composer:normalize:fix
49+
50+
- name: 'PHP syntax checker'
51+
shell: bash
52+
run: composer php:lint
53+
54+
- name: 'Prettier'
55+
shell: bash
56+
continue-on-error: true
57+
run: ./prettier.sh --write
58+
59+
- name: 'Run PHPUnit unit tests'
60+
shell: bash
61+
run: composer test:unit
4162

42-
- name: 'Lint PHP Code'
63+
- name: 'Run PHPUnit functional tests'
4364
shell: bash
44-
run: composer lint-fix
65+
run: composer test:functional
4566

4667
- name: 'Create pull-request'
47-
uses: peter-evans/create-pull-request@v6.0.2
68+
uses: peter-evans/create-pull-request@v7
4869
with:
49-
token: ${{ secrets.GITHUB_TOKEN }}
50-
commit-message: "[automated] Apply Coding Standard"
51-
base: 'main'
70+
commit-message: 'refactor: Apply Coding Standard'
5271
branch: 'automated-apply-coding-standards'
5372
title: '[automated] Apply Coding Standard'
5473
labels: 'automated'
5574
delete-branch: true
56-
57-
- name: 'Enable Pull Request Merge when ready'
58-
if: steps.cpr.outputs.pull-request-operation == 'created'
59-
run: gh pr merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
60-
env:
61-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
name: Test TYPO3 Extension
22

3-
on: [ push, pull_request ]
3+
# Make sure only one build is running per branch at a time
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
pull_request:
13+
branches:
14+
- main
415

516
permissions:
617
contents: read
@@ -9,13 +20,12 @@ permissions:
920
jobs:
1021
test:
1122
runs-on: ubuntu-latest
12-
name: TYPO3 ${{ matrix.typo3}} tests on PHP ${{ matrix.php }}
23+
name: TYPO3 v13.4 tests on PHP ${{ matrix.php }}
1324

1425
strategy:
1526
fail-fast: false
1627
matrix:
17-
php: [ 8.1, 8.2 ]
18-
typo3: [ 12.4 ]
28+
php: [8.3, 8.4]
1929

2030
steps:
2131
- name: 'Checkout code'
@@ -39,46 +49,45 @@ jobs:
3949
uses: actions/cache@v4
4050
with:
4151
path: ${{ steps.composer-cache.outputs.dir }}
42-
key: composer-php${{ matrix.php }}-typo3${{ matrix.typo3 }}
52+
key: composer-php${{ matrix.php }}
4353

4454
- name: 'Validate composer.json and composer.lock'
4555
shell: bash
4656
run: composer validate --strict
4757

48-
- name: 'Install TYPO3 core'
58+
- name: 'Install Composer Dependencies'
4959
shell: bash
50-
run: composer require typo3/cms-core="^${{ matrix.typo3 }}" -W
60+
run: composer install --no-interaction
5161

5262
- name: 'PHPUnit unit tests'
5363
shell: bash
54-
run: composer test-unit
64+
run: composer test:unit
5565

5666
- name: 'PHPUnit functional tests'
5767
shell: bash
58-
run: composer test-functional
68+
run: composer test:functional
5969

60-
# merge result files from unit tests and functional tests
6170
- name: 'Merge Coverage Reports'
6271
shell: bash
63-
run: .Build/bin/phpcov merge --php .Build/logs/coverage.php --html .Build/logs/coverage/merged --cobertura .Build/logs/cobertura.xml .Build/logs/coverage/
72+
run: .Build/bin/phpcov merge --html .Build/artifacts/coverage/merged --clover .Build/artifacts/coverage/clover.xml .Build/artifacts/coverage/
6473

65-
# finally use the cobertura report and generate coverage summary
66-
- name: 'Code Coverage Summary Report'
67-
uses: irongut/[email protected]
74+
- name: 'Generate code coverage summary report'
75+
uses: saschanowak/[email protected]
6876
with:
69-
filename: .Build/logs/cobertura.xml
70-
badge: true
71-
# there are not enough tests yet
72-
fail_below_min: false
73-
format: markdown
74-
hide_branch_rate: true
75-
hide_complexity: false
76-
indicators: true
77-
output: both
78-
thresholds: '60 80'
79-
80-
- name: Add Coverage PR Comment
77+
filename: .Build/artifacts/coverage/clover.xml
78+
79+
- name: 'Add code coverage summary as action run comment'
80+
run: |
81+
cat code-coverage-summary.md >> $GITHUB_STEP_SUMMARY
82+
cat code-coverage-details.md >> $GITHUB_STEP_SUMMARY
83+
84+
- name: 'Add title to code coverage summary'
85+
shell: bash
86+
run: sed -i '1 i\## TYPO3 v13.4 tests on PHP ${{ matrix.php }}' code-coverage-summary.md
87+
88+
- name: 'Add code coverage summary as pr comment'
8189
uses: marocchino/sticky-pull-request-comment@v2
8290
with:
91+
header: coverage-${{ matrix.php }}
8392
recreate: true
84-
path: code-coverage-results.md
93+
path: code-coverage-summary.md

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.Build/
22
.idea/
3-
Build/testing-docker/.env
43
composer.lock
54
.phpunit.result.cache
6-
var
5+
var

.phprc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.3

.prettierrc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"arrowParens": "avoid",
3+
"quoteProps": "consistent",
4+
"printWidth": 180,
5+
"singleQuote": true,
6+
"overrides": [
7+
{
8+
"files": ["*.php"],
9+
"options": {
10+
"printWidth": 115,
11+
"plugins": ["@prettier/plugin-php"]
12+
}
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)