Skip to content

Commit b4717f3

Browse files
committed
Adding CI
1 parent 6ab6d0c commit b4717f3

File tree

16 files changed

+268
-15
lines changed

16 files changed

+268
-15
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_size = 4
10+
indent_style = space
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[Makefile]
15+
indent_style = tab
16+
17+
[phpunit.xml.dist]
18+
indent_size = 2
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

.github/.cache/phpstan/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

.github/.cache/psalm/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
needs: matrix
9+
name: Test
10+
runs-on: Ubuntu-20.04
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: 8.0
20+
coverage: none
21+
22+
- name: Download dependencies
23+
uses: ramsey/composer-install@v1
24+
25+
- name: Run tests
26+
run: ./vendor/bin/phpunit
27+

.github/workflows/static.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Static analysis
2+
3+
on:
4+
pull_request: ~
5+
6+
jobs:
7+
phpstan:
8+
name: PHPStan
9+
runs-on: Ubuntu-20.04
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Cache PHPStan
16+
uses: actions/cache@v2
17+
with:
18+
path: .github/.cache/phpstan/
19+
key: phpstan-${{ github.sha }}
20+
restore-keys: phpstan-
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 8.0
26+
coverage: none
27+
28+
- name: Download dependencies
29+
uses: ramsey/composer-install@v1
30+
with:
31+
composer-options: --no-interaction --prefer-dist --optimize-autoloader
32+
33+
- name: Download PHPStan
34+
run: composer bin phpstan update --no-interaction --no-progress
35+
36+
- name: Execute PHPStan
37+
run: vendor/bin/phpstan analyze --no-progress
38+
39+
php-cs-fixer:
40+
name: PHP-CS-Fixer
41+
runs-on: Ubuntu-20.04
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
47+
- name: Cache PhpCsFixer
48+
uses: actions/cache@v2
49+
with:
50+
path: .github/.cache/php-cs-fixer/
51+
key: php-cs-fixer-${{ github.sha }}
52+
restore-keys: php-cs-fixer-
53+
54+
- name: Setup PHP
55+
uses: shivammathur/setup-php@v2
56+
with:
57+
php-version: 8.0
58+
coverage: none
59+
60+
- name: Download dependencies
61+
uses: ramsey/composer-install@v1
62+
with:
63+
composer-options: --no-interaction --prefer-dist --optimize-autoloader
64+
65+
- name: Download PHP CS Fixer
66+
run: composer bin php-cs-fixer update --no-interaction --no-progress
67+
68+
- name: Execute PHP CS Fixer
69+
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
70+
71+
psalm:
72+
name: Psalm
73+
runs-on: Ubuntu-20.04
74+
steps:
75+
- name: Checkout code
76+
uses: actions/checkout@v2
77+
78+
- name: Cache Psalm
79+
uses: actions/cache@v2
80+
with:
81+
path: .github/.cache/psalm/
82+
key: psalm-${{ github.sha }}
83+
restore-keys: psalm-
84+
85+
- name: Setup PHP
86+
uses: shivammathur/setup-php@v2
87+
with:
88+
php-version: 8.0
89+
coverage: none
90+
91+
- name: Download dependencies
92+
uses: ramsey/composer-install@v1
93+
with:
94+
composer-options: --no-interaction --prefer-dist --optimize-autoloader
95+
96+
- name: Download Psalm
97+
run: composer bin psalm update --no-interaction --no-progress
98+
99+
- name: Execute Psalm
100+
run: vendor/bin/psalm.phar --no-progress --output-format=github
101+
102+
composer-normalize:
103+
name: Composer Normalize
104+
runs-on: Ubuntu-20.04
105+
106+
steps:
107+
- name: Set up PHP
108+
uses: shivammathur/setup-php@v2
109+
with:
110+
php-version: 8.0
111+
coverage: none
112+
tools: composer-normalize
113+
114+
- name: Checkout code
115+
uses: actions/checkout@v2
116+
117+
- name: Normalize
118+
run: composer-normalize --dry-run

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@
88
/var/
99
/vendor/
1010
###< symfony/framework-bundle ###
11+
12+
13+
###> phpunit/phpunit ###
14+
/phpunit.xml
15+
.phpunit.result.cache
16+
###< phpunit/phpunit ###

.php_cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
;
6+
7+
return PhpCsFixer\Config::create()
8+
->setCacheFile(__DIR__.'/.github/.cache/php-cs-fixer/.php_cs.cache')
9+
->setRiskyAllowed(true)
10+
->setRules([
11+
'@PSR2' => true,
12+
'@Symfony' => true,
13+
])
14+
->setFinder($finder)
15+
;

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"symfony/process": "^5.2",
1717
"symfony/yaml": "^5.2"
1818
},
19+
"require-dev": {
20+
"bamarni/composer-bin-plugin": "^1.4.1",
21+
"phpunit/phpunit": "^9.3.10"
22+
},
1923
"replace": {
2024
"symfony/polyfill-ctype": "*",
2125
"symfony/polyfill-iconv": "*"

0 commit comments

Comments
 (0)