File tree Expand file tree Collapse file tree 8 files changed +121
-10
lines changed Expand file tree Collapse file tree 8 files changed +121
-10
lines changed Original file line number Diff line number Diff line change 1+ /.github export-ignore
2+ /docs export-ignore
3+ /examples export-ignore
4+ /tests export-ignore
5+ /.editorconfig export-ignore
6+ /.gitattributes export-ignore
7+ /.gitignore export-ignore
8+ /phpunit.xml.dist export-ignore
9+ /phpstan.neon.dist export-ignore
10+
11+ # Configure diff output for .php and .phar files.
12+ * .php diff =php
13+ * .phar - diff
Original file line number Diff line number Diff line change 1+ version : 2
2+ updates :
3+ - package-ecosystem : composer
4+ directory : " /"
5+ schedule :
6+ interval : daily
7+ open-pull-requests-limit : 10
8+
9+ - package-ecosystem : " github-actions"
10+ directory : " /"
11+ schedule :
12+ interval : daily
Original file line number Diff line number Diff line change 1+ # When a PR is opened or a push is made, perform
2+ # a static analysis check on the code using PHPStan.
3+ name : PHPStan
4+
5+ on :
6+ pull_request :
7+ branches :
8+ - ' develop'
9+ paths :
10+ - ' src/**'
11+ - ' tests/**'
12+ - ' phpstan*'
13+ - ' .github/workflows/analyze.yml'
14+ push :
15+ branches :
16+ - ' develop'
17+ paths :
18+ - ' src/**'
19+ - ' tests/**'
20+ - ' phpstan*'
21+ - ' .github/workflows/analyze.yml'
22+
23+ jobs :
24+ build :
25+ name : Analyze code
26+ runs-on : ubuntu-latest
27+ steps :
28+ - name : Checkout
29+ uses : actions/checkout@v2
30+
31+ - name : Setup PHP
32+ uses : shivammathur/setup-php@v2
33+ with :
34+ php-version : ' 7.4'
35+ extensions : intl
36+
37+ - name : Get composer cache directory
38+ id : composer-cache
39+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
40+
41+ - name : Cache composer dependencies
42+ uses : actions/cache@v2
43+ with :
44+ path : ${{ steps.composer-cache.outputs.dir }}
45+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
46+ restore-keys : ${{ runner.os }}-composer-
47+
48+ - name : Create PHPStan cache directory
49+ run : mkdir -p build/phpstan
50+
51+ - name : Cache PHPStan results
52+ uses : actions/cache@v2
53+ with :
54+ path : build/phpstan
55+ key : ${{ runner.os }}-phpstan-${{ github.sha }}
56+ restore-keys : ${{ runner.os }}-phpstan-
57+
58+ - name : Install dependencies
59+ run : composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader
60+ env :
61+ COMPOSER_AUTH : ${{ secrets.COMPOSER_AUTH }}
62+
63+ - name : Run static analysis
64+ run : vendor/bin/phpstan analyze
Original file line number Diff line number Diff line change 3434 run : echo "::set-output name=dir::$(composer config cache-files-dir)"
3535
3636 - name : Cache composer dependencies
37- uses : actions/cache@v1
37+ uses : actions/cache@v2
3838 with :
3939 path : ${{ steps.composer-cache.outputs.dir }}
4040 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
4646 COMPOSER_AUTH : ${{ secrets.COMPOSER_AUTH }}
4747
4848 - name : Test with phpunit
49- run : vendor/bin/phpunit --coverage-text
49+ run : vendor/bin/phpunit --verbose -- coverage-text
Original file line number Diff line number Diff line change 1- / vendor /
1+ vendor /
22build /
33phpunit * .xml
44phpunit
Original file line number Diff line number Diff line change 3232 },
3333 "require-dev" : {
3434 "codeigniter4/codeigniter4" : " dev-develop" ,
35- "mikey179/vfsstream" : " 1.6.*" ,
36- "phpunit/phpunit" : " ^8.5"
35+ "fzaninotto/faker" : " ^1.9@dev" ,
36+ "mikey179/vfsstream" : " ^1.6" ,
37+ "phpunit/phpunit" : " ^8.5" ,
38+ "phpstan/phpstan" : " ^0.12" ,
39+ "squizlabs/php_codesniffer" : " ^3.5" ,
40+ "codeigniter4/codeigniter4-standard" : " ^1.0"
3741 },
3842 "autoload" : {
3943 "psr-4" : {
4650 }
4751 },
4852 "scripts" : {
53+ "analyze" : " phpstan analyze" ,
54+ "style" : " phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 src/ tests/" ,
4955 "test" : " phpunit" ,
5056 "post-update-cmd" : [
5157 " composer dump-autoload"
Original file line number Diff line number Diff line change 1+ parameters:
2+ tmpDir: build/phpstan
3+ level: 5
4+ paths:
5+ - src
6+ - tests
7+ bootstrapFiles:
8+ - vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php
9+ excludes_analyse:
10+ - src/Config/Routes.php
11+ - src/Views/*
12+ ignoreErrors:
13+ - '#Call to an undefined static method Config\\Services::manifests\(\)#'
14+ - '#Unsafe usage of new static\(\)*#'
15+ scanDirectories:
16+ - vendor/codeigniter4/codeigniter4/system/Helpers
17+ dynamicConstantNames:
18+ - APP_NAMESPACE
19+ - CI_DEBUG
20+ - ENVIRONMENT
Original file line number Diff line number Diff line change 2424 </exclude >
2525 </whitelist >
2626 </filter >
27-
27+
2828 <logging >
2929 <log type =" coverage-html" target =" build/logs/html" />
3030 <log type =" coverage-clover" target =" build/logs/clover.xml" />
4747 <!-- Directory containing the front controller (index.php) -->
4848 <const name =" PUBLICPATH" value =" ./vendor/codeigniter4/codeigniter4/public/" />
4949
50- <!-- https://getcomposer.org/xdebug -->
51- <env name =" COMPOSER_DISABLE_XDEBUG_WARN" value =" 1" />
52-
53- <!-- Database configuration -->
5450<!-- <env name="database.tests.hostname" value="localhost"/> -->
5551<!-- <env name="database.tests.database" value="tests"/> -->
5652<!-- <env name="database.tests.username" value="tests_user"/> -->
You can’t perform that action at this time.
0 commit comments