-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (44 loc) · 1.33 KB
/
reusable_phplinter.yml
File metadata and controls
51 lines (44 loc) · 1.33 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
---
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
php-version:
description: 'The PHP-version to use for linting'
type: string
required: true
repository:
description: 'The repository that needs linting'
type: string
required: false
default: ${{ github.repository }}
ref:
description: 'The branch, tag or SHA that needs linting'
type: string
required: false
default: ${{ github.ref }}
env:
supported: '["8.3", "8.4", "8.5"]'
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Supported version check
if: contains(fromJSON(env.supported), inputs.php-version) == false
run: exit 1
- name: Checkout Code
uses: actions/checkout@v6
with:
fetch-depth: 0
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
- name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
tools: phive
php-version: ${{ inputs.php-version }}
coverage: "none"
extensions: :redis
- name: Install overtrue/phplint (latest)
run: phive install overtrue/phplint --force-accept-unsigned --target ./bin
- name: Lint PHP files
run: ./bin/phplint --no-cache --no-progress -v