-
-
Notifications
You must be signed in to change notification settings - Fork 283
63 lines (49 loc) · 2.15 KB
/
format.yaml
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
59
60
61
62
name: Code style analysis
on:
pull_request: ~
push:
branches:
- master
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [7.4]
dependency-version: [prefer-stable]
name: ${{ matrix.php }} - ${{ matrix.dependency-version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, mbstring, zip
coverage: none
tools: cs2pr
- name: Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --ansi --no-interaction --prefer-dist
- name: PHPStan
run: composer run phpstan:test -- --error-format=checkstyle | cs2pr
- name: PHP CS Fixer
run: composer run csfixer:test -- --dry-run
- name: Rector
run: composer run rector:test -- --dry-run
- name: PHPInsight on modified files
if: github.event_name == 'pull_request'
run: |
URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/files"
FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select( .status == "added" or .status == "modified") | select(.filename|endswith(".php")) | .filename')
php bin/phpinsights analyse $FILES --ansi -v --no-interaction --format=github-action --min-quality=0 --min-complexity=0 --min-architecture=0 --min-style=0
- name: PHPInsight
run: composer run insights
- name: PHPInsight - Summary only
run: composer run insights -- --summary