File tree 5 files changed +89
-3
lines changed
5 files changed +89
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Codestyle
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches : [ $default-branch ]
7
+
8
+ permissions :
9
+ contents : read
10
+
11
+ jobs :
12
+ build :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - uses : actions/checkout@v3
17
+
18
+ - name : Cache Composer packages
19
+ id : composer-cache
20
+ uses : actions/cache@v3
21
+ with :
22
+ path : vendor
23
+ key : ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }}
24
+ restore-keys : |
25
+ ${{ runner.os }}-php-
26
+
27
+ - name : Install dependencies
28
+ run : composer install --prefer-dist --no-progress
29
+
30
+ - name : Check code style
31
+ run : composer run-script codestyle:lint
Original file line number Diff line number Diff line change
1
+ name : PHP Composer
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches : [ $default-branch ]
7
+
8
+ permissions :
9
+ contents : read
10
+
11
+ jobs :
12
+ build :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - uses : actions/checkout@v3
17
+
18
+ - name : Validate composer.json and composer.lock
19
+ run : composer validate --strict
20
+
21
+ - name : Cache Composer packages
22
+ id : composer-cache
23
+ uses : actions/cache@v3
24
+ with :
25
+ path : vendor
26
+ key : ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }}
27
+ restore-keys : |
28
+ ${{ runner.os }}-php-
29
+
30
+ - name : Install dependencies
31
+ run : composer install --prefer-dist --no-progress
32
+
33
+ - name : Run test suite
34
+ run : composer run-script test
Original file line number Diff line number Diff line change @@ -3,11 +3,13 @@ codeCoverage/
3
3
vendor /
4
4
composer.lock
5
5
.php_cs.cache
6
+ .php-cs-fixer.php
7
+ .php-cs-fixer.cache
6
8
_ide_helper.php
7
9
.phpstorm.meta.php
8
10
coverage
9
11
coverage.xml
10
12
phpunit.local.xml
11
13
.phpunit.result.cache
12
14
composer.lock
13
- /tests /_output
15
+ /tests /_output
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ finder = PhpCsFixer \Finder::create ()
4
+ ->in ('src ' )
5
+ ->append ([__FILE__ ])
6
+ ;
7
+
8
+ $ config = new PhpCsFixer \Config ();
9
+
10
+ return $ config
11
+ ->setRules ([
12
+ '@PSR12 ' => true ,
13
+ 'array_syntax ' => ['syntax ' => 'short ' ],
14
+ ])
15
+ ->setFinder ($ finder )
16
+ ;
Original file line number Diff line number Diff line change 9
9
"EDI\\ Generator\\ " : " src/Generator/"
10
10
}
11
11
},
12
- "require" : {
12
+ "scripts" : {
13
+ "test" : " vendor/bin/phpunit" ,
14
+ "codestyle:fix" : " vendor/bin/php-cs-fixer fix" ,
15
+ "codestyle:lint" : " vendor/bin/php-cs-fixer fix --dry-run"
13
16
},
14
17
"require-dev" : {
15
18
"sabas/edifact" : " ^0.4.1" ,
16
19
"phpunit/phpunit" : " ~8.0" ,
17
- "friendsofphp/php-cs-fixer" : " ^2.14 "
20
+ "friendsofphp/php-cs-fixer" : " ^3.9.5 "
18
21
}
19
22
}
You can’t perform that action at this time.
0 commit comments