-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (68 loc) · 2.8 KB
/
Copy pathstatic-analysis.yml
File metadata and controls
81 lines (68 loc) · 2.8 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: "Code coverage"
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
php-version:
description: "The PHP version to use when running the job"
default: "8.0"
required: false
type: "string"
php-extensions:
description: "The php extensions to install, allowing composer to pass"
default: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix, opcache"
required: false
type: "string"
composer-root-version:
description: "The version of the package being tested, in case of circular dependencies."
required: false
type: "string"
composer-options:
description: "Additional flags for the composer install command."
default: "--prefer-dist"
required: false
type: "string"
composer-dependencies:
description: "Composer dependency level to install"
default: "locked"
required: false
type: "string"
jobs:
static-code-analysis:
name: "Static Code Analysis"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "${{ inputs.php-version }}"
steps:
- name: "Checkout"
uses: "actions/checkout@v7"
- name: "Install PHP"
uses: "shivammathur/setup-php@2.37.2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: "${{ inputs.php-extensions }}"
- name: "Set COMPOSER_ROOT_VERSION"
run: |
echo "COMPOSER_ROOT_VERSION=${{ inputs.composer-root-version }}" >> $GITHUB_ENV
if: "${{ inputs.composer-root-version }}"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ inputs.composer-dependencies }}"
composer-options: "${{ inputs.composer-options }}"
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m") # yamllint disable-line rule:quoted-strings
- name: "Create cache directory for phpstan/phpstan"
run: "mkdir -p .build/phpstan"
- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1"
- name: "Create cache directory for vimeo/psalm"
run: "mkdir -p .build/psalm"
- name: "Run vimeo/psalm"
if: "${{ hashFiles('vendor/bin/psalm') != '' }}"
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"
- name: "Run vimeo/psalm"
if: "${{ hashFiles('vendor/bin/psalm.phar') != '' }}"
run: "vendor/bin/psalm.phar --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"