Repository navigation
55 lines (48 loc) · 1.64 KB
/
Copy pathphpstan.yaml
File metadata and controls
55 lines (48 loc) · 1.64 KB
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
name: Check for bugs with PHPStan static analysis tool
on:
workflow_call:
inputs:
php:
description: PHP Version to use
default: 8.2
required: false
type: string
install-phpunit-bridge:
description: Installs PHPUnit before running PHPStan
default: false
required: false
type: boolean
working-directory:
description: Working directory for the workflow
default: .
required: false
type: string
tool-directory:
description: Directory where the tool is installed
default: tools/phpstan
required: false
type: string
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php }}
- name: Install Composer dependencies
working-directory: ${{ inputs.working-directory }}
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Install PHPUnit (simple-phpunit)
if: ${{ true == inputs.install-phpunit-bridge }}
working-directory: ${{ inputs.working-directory }}
run: vendor/bin/simple-phpunit --version
- name: Install PHPStan
working-directory: ${{ inputs.working-directory }}
run: composer upgrade --no-progress --no-scripts --prefer-dist --working-dir=${{ inputs.tool-directory }}
- name: Run PHPStan
working-directory: ${{ inputs.working-directory }}
run: ${{ inputs.tool-directory }}/vendor/bin/phpstan analyse