Skip to content

Commit 122db1a

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

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/phplinter.yml

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

0 commit comments

Comments
 (0)