Skip to content

Commit d12ec7f

Browse files
authored
Merge pull request #65 from Kdyby/feature/github-ci
upgrade + ci: github: init
2 parents 24da422 + 69de580 commit d12ec7f

File tree

12 files changed

+408
-183
lines changed

12 files changed

+408
-183
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = tab
8+
insert_final_newline = true
9+
max_line_length = 120
10+
tab_width = 4
11+
trim_trailing_whitespace = true

.github/workflows/ci.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
parallel-lint:
9+
name: 🔎 Parallel lint
10+
runs-on: 'ubuntu-latest'
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php:
15+
- "8.2"
16+
- "8.3"
17+
- "8.4"
18+
dependencies:
19+
- "highest"
20+
steps:
21+
- name: ⬇️ Checkout repo
22+
uses: actions/checkout@v4
23+
24+
- name: 🐘 Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
coverage: none
29+
30+
- name: 📥 Install dependencies
31+
uses: ramsey/composer-install@v3
32+
with:
33+
dependency-versions: "${{ matrix.dependencies }}"
34+
35+
- name: 🔎 Parallel lint
36+
run: php ./vendor/bin/parallel-lint -e php,phpt --exclude ./.git --exclude ./vendor .
37+
38+
phpstan:
39+
name: 🟩️️ PHPStan
40+
runs-on: 'ubuntu-latest'
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
php:
45+
- "8.2"
46+
- "8.3"
47+
- "8.4"
48+
dependencies:
49+
- "lowest"
50+
- "highest"
51+
steps:
52+
- name: ⬇️ Checkout repo
53+
uses: actions/checkout@v4
54+
55+
- name: 🐘 Setup PHP
56+
uses: shivammathur/setup-php@v2
57+
with:
58+
php-version: ${{ matrix.php }}
59+
coverage: none
60+
61+
- name: 📥 Install dependencies
62+
uses: ramsey/composer-install@v3
63+
with:
64+
dependency-versions: "${{ matrix.dependencies }}"
65+
66+
- name: 🟩️️ PHPStan
67+
run: php ./vendor/bin/phpstan --ansi
68+
69+
ecs:
70+
name: ✏️️ ECS
71+
runs-on: 'ubuntu-latest'
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
php:
76+
- "8.2"
77+
- "8.3"
78+
- "8.4"
79+
dependencies:
80+
- "highest"
81+
steps:
82+
- name: ⬇️ Checkout repo
83+
uses: actions/checkout@v4
84+
85+
- name: 🐘 Setup PHP
86+
uses: shivammathur/setup-php@v2
87+
with:
88+
php-version: ${{ matrix.php }}
89+
coverage: none
90+
91+
- name: 📥 Install dependencies
92+
uses: ramsey/composer-install@v3
93+
with:
94+
dependency-versions: "${{ matrix.dependencies }}"
95+
96+
- name: ✏️️ ECS
97+
run: php ./vendor/bin/ecs
98+
99+
rector:
100+
name: 🛠️ Rector
101+
runs-on: 'ubuntu-latest'
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
php:
106+
- "8.2"
107+
- "8.3"
108+
- "8.4"
109+
dependencies:
110+
- "highest"
111+
steps:
112+
- name: ⬇️ Checkout repo
113+
uses: actions/checkout@v4
114+
115+
- name: 🐘 Setup PHP
116+
uses: shivammathur/setup-php@v2
117+
with:
118+
php-version: ${{ matrix.php }}
119+
coverage: none
120+
121+
- name: 📥 Install dependencies
122+
uses: ramsey/composer-install@v3
123+
with:
124+
dependency-versions: "${{ matrix.dependencies }}"
125+
126+
- name: 🛠️ Rector
127+
run: php ./vendor/bin/rector process --dry-run --ansi
128+
129+
tester:
130+
name: 🧮 Tester
131+
runs-on: 'ubuntu-latest'
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
php:
136+
- "8.2"
137+
- "8.3"
138+
- "8.4"
139+
dependencies:
140+
- "lowest"
141+
- "highest"
142+
steps:
143+
- name: ⬇️ Checkout repo
144+
uses: actions/checkout@v4
145+
146+
- name: 🐘 Setup PHP
147+
uses: shivammathur/setup-php@v2
148+
with:
149+
php-version: ${{ matrix.php }}
150+
coverage: xdebug
151+
152+
- name: 📥 Install dependencies
153+
uses: ramsey/composer-install@v3
154+
with:
155+
dependency-versions: "${{ matrix.dependencies }}"
156+
157+
- name: 🧮 Tester
158+
run: php ./vendor/bin/tester -s -p php --colors 1 -C ./tests/Replicator

.travis.yml

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

composer.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,22 @@
2121
"issues": "https://github.com/Kdyby/FormsReplicator/issues"
2222
},
2323
"require": {
24-
"php": ">=7.1",
25-
"nette/forms": "^3.0",
24+
"php": ">= 8.2",
25+
"nette/forms": "^3.2.3",
2626
"nette/utils": "^3.0 || ^4.0"
2727
},
2828
"require-dev": {
29-
"nette/application": "^3.0@rc",
30-
"nette/bootstrap": "^3.0@rc",
31-
"nette/di": "^3.0@rc",
32-
"tracy/tracy": "^2.6",
33-
"nette/tester": "^2.2"
29+
"nette/application": "^3.0",
30+
"nette/bootstrap": "^3.0",
31+
"nette/di": "^3.0",
32+
"tracy/tracy": "^2.10.8",
33+
"nette/tester": "^2.5",
34+
"php-parallel-lint/php-console-highlighter": "^1.0",
35+
"php-parallel-lint/php-parallel-lint": "^1.4",
36+
"phpstan/phpstan": "^2.1",
37+
"rector/rector": "^2.0",
38+
"symplify/easy-coding-standard": "^12.5",
39+
"nette/neon": "^3.4.4"
3440
},
3541
"autoload": {
3642
"psr-4": {
@@ -47,7 +53,7 @@
4753
},
4854
"extra": {
4955
"branch-alias": {
50-
"dev-master": "2.0-dev"
56+
"dev-master": "3.0-dev"
5157
}
5258
}
5359
}

ecs.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Fixer\Casing\ConstantCaseFixer;
6+
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
7+
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
8+
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
9+
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
10+
use Symplify\EasyCodingStandard\Config\ECSConfig;
11+
use Symplify\EasyCodingStandard\ValueObject\Option;
12+
13+
/**
14+
* https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/index.rst
15+
* https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/ruleSets/index.rst
16+
*/
17+
18+
/**
19+
* https://github.com/slevomat/coding-standard
20+
*/
21+
return ECSConfig
22+
::configure()
23+
->withPaths(
24+
[
25+
__DIR__ . '/src',
26+
__DIR__ . '/tests/Replicator',
27+
]
28+
)
29+
->withRootFiles()
30+
->withParallel()
31+
->withSpacing(indentation: Option::INDENTATION_TAB, lineEnding: PHP_EOL)
32+
->withPreparedSets(psr12: true, common: true, symplify: true, cleanCode: true)
33+
->withSkip([
34+
GeneralPhpdocAnnotationRemoveFixer::class,
35+
OrderedClassElementsFixer::class,
36+
LineLengthFixer::class,
37+
ConstantCaseFixer::class,
38+
NotOperatorWithSuccessorSpaceFixer::class,
39+
])
40+
;

phpstan.dist.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://phpstan.org/config-reference
2+
3+
parameters:
4+
level: 1
5+
paths:
6+
- src/

rector.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
/**
8+
* https://getrector.com/find-rule
9+
*/
10+
return RectorConfig
11+
::configure()
12+
->withPaths(
13+
[
14+
__DIR__ . '/src',
15+
__DIR__ . '/tests/Replicator',
16+
]
17+
)
18+
->withRootFiles()
19+
->withParallel()
20+
->withPhpSets(
21+
php82: true,
22+
)
23+
;

0 commit comments

Comments
 (0)