Skip to content

Commit b4a7016

Browse files
committed
Add GitHub WorkFlow for Code Analyse
1 parent 803b80b commit b4a7016

File tree

1 file changed

+50
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)