Skip to content

Commit 1f32c9c

Browse files
committed
Add reusable phplinter-workflow
1 parent d777583 commit 1f32c9c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/phplinter.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
3+
name: 'phplinter'
4+
description: 'Run PHP linter'
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
php-version:
10+
description: 'The PHP-version to use for linting'
11+
required: true
12+
repository:
13+
description: 'The repository that needs linting'
14+
required: true
15+
ref:
16+
description: 'The branch, tag or SHA that needs linting'
17+
required: false
18+
default: 'master'
19+
20+
jobs:
21+
linter:
22+
using: 'composite'
23+
steps:
24+
- name: Checkout Code
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
repository: ${{ inputs.repository }}
29+
ref: ${{ inputs.ref }}
30+
31+
- name: Setup PHP runtime
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
tools: phive
35+
php-version: ${{ inputs.php-version }}
36+
coverage: "none"
37+
38+
- name: Lint PHP files
39+
run: |
40+
phive install overtrue/phplint --force-accept-unsigned
41+
phplint --no-cache --no-progress -v

0 commit comments

Comments
 (0)