-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (53 loc) · 1.39 KB
/
check-cs-checker.yml
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
52
53
54
55
56
57
58
name: CS Check
on:
push:
branches:
- master
pull_request:
branches:
- "*"
jobs:
detect-errors:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer
- name: Install dependencies
run: |
composer update --prefer-dist --no-progress
- name: Run PHPCS
run: vendor/bin/phpcs $(find tests/input/* | sort) --report=summary --report-file=phpcs.log || true
- name: Check output
run: diff tests/expected_report.txt phpcs.log
fix-errors:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer
- name: Install dependencies
run: |
composer update --prefer-dist --no-progress
- name: Copy target folder
run: cp -R tests/input/ tests/input2/
- name: Run PHPCS fixer
run: vendor/bin/phpcbf tests/input2 || true
- name: Check output
run: diff tests/input2 tests/fixed