Skip to content

Commit bac04b2

Browse files
committed
Add Github actions to check Code quality (PhpStan)
1 parent 803e2e0 commit bac04b2

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/code_analysis.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Code Analysis
2+
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
11+
jobs:
12+
code_analysis:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
actions:
17+
- name: PHPStan
18+
run: composer phpstan
19+
20+
name: ${{ matrix.actions.name }}
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
27+
28+
# see https://github.com/shivammathur/setup-php
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: 7.3
33+
coverage: none
34+
35+
36+
# see https://github.com/actions/cache/blob/main/examples.md#php---composer
37+
- name: Get Composer Cache Directory
38+
id: composer-cache
39+
run: |
40+
echo "::set-output name=dir::$(composer config cache-files-dir)"
41+
- uses: actions/cache@v2
42+
with:
43+
path: |
44+
${{ steps.composer-cache.outputs.dir }}
45+
**/composer.lock
46+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
47+
restore-keys: |
48+
${{ runner.os }}-composer-
49+
50+
51+
- name: Install Composer
52+
run: composer install --no-progress
53+
54+
55+
- run: ${{ matrix.actions.run }}

0 commit comments

Comments
 (0)