Skip to content

Commit 24e204a

Browse files
authored
Make sure CI run (#40)
* Adding static analyzer * Added meta files * cs
1 parent d1985c2 commit 24e204a

File tree

13 files changed

+187
-49
lines changed

13 files changed

+187
-49
lines changed

.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: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
name: CI
2-
3-
on:
4-
schedule:
5-
- cron: 0 2 * * 1-5
6-
pull_request:
7-
push:
8-
branches:
9-
- master
1+
name: Tests
2+
on: [ pull_request ]
103

114
jobs:
125
tests:
13-
name: Tests PHP ${{ matrix.php }} ${{ matrix.dependency }} (Symfony ${{ matrix.symfony }})
6+
name: PHPUnit PHP ${{ matrix.php }} ${{ matrix.dependency }} (Symfony ${{ matrix.symfony }})
147
runs-on: ubuntu-latest
158
strategy:
169
matrix:
@@ -61,7 +54,7 @@ jobs:
6154
uses: shivammathur/setup-php@v2
6255
with:
6356
php-version: ${{ matrix.php }}
64-
extensions: composer:v2, flex, pcov
57+
extensions: composer, flex, pcov
6558

6659
- name: Configure Symfony
6760
run: composer config extra.symfony.require "${{ matrix.symfony }}"

.github/workflows/static.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
on: [pull_request]
2+
name: Static analysis
3+
4+
jobs:
5+
phpstan:
6+
name: PHPStan
7+
runs-on: ubuntu-20.04
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.0
17+
coverage: none
18+
tools: phpstan:0.12.92, cs2pr
19+
20+
- name: Download dependencies
21+
uses: ramsey/composer-install@v1
22+
23+
- name: PHPStan
24+
run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr
25+
26+
php-cs-fixer:
27+
name: PHP-CS-Fixer
28+
runs-on: ubuntu-20.04
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: 8.0
38+
coverage: none
39+
tools: php-cs-fixer:2.19.0, cs2pr
40+
41+
- name: PHP-CS-Fixer
42+
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
43+
44+
psalm:
45+
name: Psalm
46+
runs-on: ubuntu-20.04
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v2
50+
51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: 8.0
55+
coverage: none
56+
tools: vimeo/psalm:4.8.1
57+
58+
- name: Download dependencies
59+
uses: ramsey/composer-install@v1
60+
61+
- name: Psalm
62+
run: psalm --no-progress --output-format=github
63+
64+
composer-normalize:
65+
name: Composer Normalize
66+
runs-on: ubuntu-20.04
67+
68+
steps:
69+
- name: Setup PHP
70+
uses: shivammathur/setup-php@v2
71+
with:
72+
php-version: 8.0
73+
coverage: none
74+
tools: composer-normalize
75+
76+
- name: Checkout code
77+
uses: actions/checkout@v2
78+
79+
- name: Normalize
80+
run: composer-normalize --dry-run

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/behat.yml
2-
/build/
31
/composer.lock
4-
/phpspec.yml
52
/phpunit.xml
63
/.phpunit.result.cache
74
/vendor/
5+
.php_cs.cache

.php_cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
/*
4-
* In order to make it work, fabpot/php-cs-fixer and sllh/php-cs-fixer-styleci-bridge must be installed globally
5-
* with composer.
6-
*
7-
* @link https://github.com/Soullivaneuh/php-cs-fixer-styleci-bridge
8-
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer
9-
*/
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/tests')
6+
;
107

11-
use SLLH\StyleCIBridge\ConfigBridge;
12-
13-
return ConfigBridge::create();
8+
return PhpCsFixer\Config::create()
9+
->setRules([
10+
'@Symfony' => true,
11+
])
12+
->setFinder($finder)
13+
;

.scrutinizer.yml

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

.styleci.yml

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

composer.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@
2020
"phpunit/phpunit": "^8.5 || ^9.4"
2121
},
2222
"autoload": {
23-
"psr-4": { "Nyholm\\BundleTest\\": "src/" }
23+
"psr-4": {
24+
"Nyholm\\BundleTest\\": "src/"
25+
}
2426
},
2527
"autoload-dev": {
26-
"psr-4": { "Nyholm\\BundleTest\\Tests\\": "tests/" }
28+
"psr-4": {
29+
"Nyholm\\BundleTest\\Tests\\": "tests/"
30+
}
2731
},
32+
"minimum-stability": "dev",
33+
"prefer-stable": true,
2834
"scripts": {
2935
"test": "vendor/bin/phpunit",
3036
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
31-
},
32-
"minimum-stability": "dev",
33-
"prefer-stable": true
37+
}
3438
}

phpstan-baseline.neon

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Access to an undefined property Nyholm\\\\BundleTest\\\\AppKernel\\:\\:\\$rootDir\\.$#"
5+
count: 1
6+
path: src/AppKernel.php
7+
8+
-
9+
message: "#^PHPDoc tag @param references unknown parameter\\: \\$bundle$#"
10+
count: 1
11+
path: src/AppKernel.php
12+
13+
-
14+
message: "#^Call to method reset\\(\\) on an unknown class Symfony\\\\Component\\\\DependencyInjection\\\\ResettableContainerInterface\\.$#"
15+
count: 1
16+
path: src/BaseBundleTestCase.php
17+
18+
-
19+
message: "#^Class Symfony\\\\Component\\\\DependencyInjection\\\\ResettableContainerInterface not found\\.$#"
20+
count: 1
21+
path: src/BaseBundleTestCase.php
22+
23+
-
24+
message: "#^PHPDoc tag @param references unknown parameter\\: \\$options$#"
25+
count: 1
26+
path: src/BaseBundleTestCase.php
27+
28+
-
29+
message: "#^Comparison operation \"\\>\\=\" between 50306 and 30300 is always true\\.$#"
30+
count: 1
31+
path: src/config/parameters.php
32+
33+
-
34+
message: "#^Comparison operation \"\\>\\=\" between 50306 and 50100 is always true\\.$#"
35+
count: 1
36+
path: src/config/parameters.php
37+
38+
-
39+
message: "#^Variable \\$container might not be defined\\.$#"
40+
count: 3
41+
path: src/config/parameters.php
42+

phpstan.neon.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: 5
6+
reportUnmatchedIgnoredErrors: false
7+
paths:
8+
- src

0 commit comments

Comments
 (0)