Skip to content

Commit a6d2110

Browse files
Larastan static analysis (#182)
Co-authored-by: JapSeyz <[email protected]> Co-authored-by: Jesper Jacobsen <[email protected]> Co-authored-by: JapSeyz <[email protected]> Co-authored-by: pascalbaljet <[email protected]>
1 parent 9bf8ed5 commit a6d2110

File tree

6 files changed

+682
-12
lines changed

6 files changed

+682
-12
lines changed
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: run-static-analysis
2+
on: [push, pull_request]
3+
4+
jobs:
5+
analyse:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: true
9+
matrix:
10+
php: [ 8.1, 8.0 ]
11+
laravel: [ 9.* ]
12+
dependency-version: [ prefer-lowest, prefer-stable ]
13+
14+
name: Analyse P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/[email protected]
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql
25+
coverage: none
26+
27+
- name: Get Composer Cache Directory 2
28+
id: composer-cache
29+
run: |
30+
echo "::set-output name=dir::$(composer config cache-files-dir)"
31+
32+
- uses: actions/cache@v2
33+
id: actions-cache
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-composer-
39+
40+
- name: Cache PHP dependencies
41+
uses: actions/cache@v2
42+
id: vendor-cache
43+
with:
44+
path: vendor
45+
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
46+
47+
- name: Install Dependencies
48+
if: steps.vendor-cache.outputs.cache-hit != 'true'
49+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
50+
51+
- name: Execute Code Static Analysis (PHP Stan + Larastan)
52+
run: |
53+
vendor/bin/phpstan analyse -c phpstan.neon --no-progress

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ composer.lock
66
coverage
77
docs
88
phpunit.xml
9-
phpstan.neon
109
testbench.yaml
1110
vendor
1211
node_modules

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"laravel/pint": "^1.0",
2424
"nunomaduro/collision": "^6.0",
2525
"nunomaduro/larastan": "^2.0.1",
26+
"orchestra/testbench": "^7.16",
2627
"phpunit/phpunit": "^9.5"
2728
},
2829
"conflict": {
@@ -71,4 +72,4 @@
7172
},
7273
"minimum-stability": "dev",
7374
"prefer-stable": true
74-
}
75+
}

0 commit comments

Comments
 (0)