-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (49 loc) · 1.87 KB
/
static.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
###############################################################################
# About GitHub Actions #
# https://docs.github.com/en/actions/learn-github-actions #
# https://www.youtube.com/watch?v=TLB5MY9BBa4 #
###############################################################################
#
# Perform static analysis of php code and force style standardization.
#
# PHPStan: static analysis https://phpstan.org/
# PHP CS Fixer: php code pattern https://github.com/FriendsOfPHP/PHP-CS-Fixer
name: Static Analysis
on: ['workflow_dispatch', 'push', 'pull_request']
concurrency:
group: static-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
name: PHP Coding Standards Fixer
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: -v --config=.php-cs-fixer.dist.php --allow-risky=yes
- name: Auto Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'style: code pattern with php-cs-fixer'
branch: ${{ github.head_ref }}
phpstan:
runs-on: ubuntu-latest
name: PHPStan - PHP Static Analysis Tool
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
coverage: none
- name: Install Dependencies
run: composer update --prefer-stable --no-interaction --no-progress
- name: Run PHPStan
run: vendor/bin/phpstan analyse --ansi --memory-limit 1G --error-format=github --debug