-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (42 loc) · 1.5 KB
/
static-analysis.yml
File metadata and controls
47 lines (42 loc) · 1.5 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
name: 'CQC: Static Analysis (PHPStan)'
on:
workflow_call:
secrets:
OP_SERVICE_ACCOUNT_TOKEN:
description: '1Password Service Account Token to use for populating composer auth.json'
required: true
OP_VAULT:
description: '1Password vault to use for populating composer auth.json'
required: false
OP_ITEM:
description: '1Password item to use for populating composer auth.json'
required: false
jobs:
phpstsan:
name: phpstan
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Detect file changes'
uses: dorny/paths-filter@v3
id: changed-files
with:
list-files: shell
filters: |
phpstan:
- added|modified: 'wp-content/plugins/core/**/*.php'
- added|modified: 'wp-content/themes/core/**/*.php'
- added|modified: 'wp-content/mu-plugins/**/*.php'
- added|modified: 'phpstan.neon.dist'
- name: 'Composer install'
if: steps.changed-files.outputs.phpstan == 'true'
uses: ./.github/actions/composer-install
with:
COMPOSER_INSTALL_FLAGS: '--optimize-autoloader'
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
OP_VAULT: ${{ secrets.OP_VAULT }}
OP_ITEM: ${{ secrets.OP_ITEM }}
- name: 'Run PHPStan static analysis'
if: steps.changed-files.outputs.phpstan == 'true'
run: composer phpstan