-
Notifications
You must be signed in to change notification settings - Fork 10
48 lines (41 loc) · 1.59 KB
/
lint.yml
File metadata and controls
48 lines (41 loc) · 1.59 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
name: lint
on:
pull_request:
paths:
- "**.php"
jobs:
lint:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Setup Composer
uses: ramsey/composer-install@v3
with:
composer-options: "--no-scripts"
- name: Setup Reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Collect changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
**.php
files_ignore: |
vendor/*
- name: Run phpcs and filter through reviewdog
if: steps.changed-files.outputs.any_changed == 'true'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./vendor/bin/phpcs --report=checkstyle ${{ steps.changed-files.outputs.all_changed_files }} | reviewdog -f=checkstyle -reporter=github-pr-annotations -filter-mode=added -name=phpcs
- name: Run phpstan and filter through reviewdog
if: steps.changed-files.outputs.any_changed == 'true' && (success() || failure())
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./vendor/bin/phpstan analyse --no-progress --configuration=phpstan.neon --error-format=checkstyle ${{ steps.changed-files.outputs.all_changed_files }} | reviewdog -f=checkstyle -reporter=github-pr-annotations -filter-mode=added -name=phpstan