-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.99 KB
/
phpstan.yml
File metadata and controls
59 lines (52 loc) · 1.99 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
56
57
58
59
name: PHPStan
on:
workflow_call:
inputs:
phpVersions:
required: false
type: string
default: '["8.2", "8.3", "8.4"]'
description: 'PHP versions to test against, JSON encoded array of strings.'
phpExtensions:
required: false
type: string
description: 'PHP extensions to install, comma separated list of strings.'
dependencies:
required: false
type: string
default: '{}'
description: 'Dependencies to install, JSON encoded map of path => repository url.'
jobs:
phpstan:
name: Static analysis with phpstan and php ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(inputs.phpVersions) }}
os: ['ubuntu-latest']
steps:
- name: Checkout code base
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ inputs.phpExtensions }}
- name: Setup dependencies
run: |
composer require -n --no-progress phpstan/phpstan
echo "Fetching the latest snapshot of icinga-php-library..."
sudo git clone -q --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git /usr/share/icinga-php/ipl
echo "Fetching the latest snapshot of icinga-php-thirdparty..."
sudo git clone -q --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git /usr/share/icinga-php/vendor
paths=`echo '${{ inputs.dependencies }}' | jq -c -r keys[]`
for path in $paths; do
url=`echo '${{ inputs.dependencies }}' | jq -r --arg path $path '.[$path]'`
echo "Cloning $url into $path..."
sudo git clone -q --depth 1 $url $path
done
- name: PHPStan
continue-on-error: true
if: ${{ ! cancelled() }}
run: ./vendor/bin/phpstan analyse