Skip to content

Commit 295c69c

Browse files
committed
Create static-analysis.yml
1 parent 53f13fe commit 295c69c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Static Analysis"
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'doc/**'
7+
pull_request:
8+
paths-ignore:
9+
- 'doc/**'
10+
11+
jobs:
12+
phpstan:
13+
name: PHPStan
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/[email protected]
19+
20+
- name: Setup PHP with PECL extension
21+
uses: shivammathur/[email protected]
22+
with:
23+
php-version: 8.0
24+
tools: composer:v2
25+
coverage: none
26+
27+
- name: Validate composer.json and composer.lock
28+
run: composer validate
29+
30+
- name: Get composer cache directory
31+
id: composer-cache
32+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
33+
34+
- name: Cache Composer packages
35+
uses: actions/[email protected]
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: phpstan-linux-php-8.0-${{ hashFiles('**/composer.lock') }}
39+
restore-keys: phpstan-linux-php-8.0-
40+
41+
- name: Install dependencies
42+
if: steps.composer-cache.outputs.cache-hit != 'true'
43+
run: composer update --prefer-stable --ignore-platform-req=php --no-progress --no-interaction
44+
45+
- name: Run PHPStan
46+
run: composer run-script phpstan -- --no-progress

0 commit comments

Comments
 (0)