-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (68 loc) · 2.43 KB
/
static-code-analysis.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
59
60
61
62
63
64
65
66
67
68
69
70
name: Static code analysis
on: pull_request
jobs:
phpmd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Reviewdog
run: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s
- name: Install PHPMD
run: |
wget -c https://phpmd.org/static/latest/phpmd.phar
php phpmd.phar --version
- name: PHPMD
run: php phpmd.phar src text codesize,unusedcode,naming | ./bin/reviewdog -efm="%f:%l %m" -name="PHPMD" -reporter=github-check
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Reviewdog
run: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s
- name: Install PHPCS
run: |
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar --version
- name: PHPCS
run: php phpcs.phar --standard=PSR2 --report=checkstyle src | ./bin/reviewdog -f=checkstyle -name="PHPCS" -reporter=github-check
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
phploc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install PHPLOC
run: |
wget https://phar.phpunit.de/phploc.phar
php phploc.phar --version
- name: PHPLOC
run: php phploc.phar src
phpcpd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install PHPCPD
run: |
wget https://phar.phpunit.de/phpcpd.phar
php phpcpd.phar --version
- name: PHPCPD
run: php phpcpd.phar --fuzzy src
phpdoccheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Reviewdog
run: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s
- name: Install phpdoccheck
run: |
composer global require block8/php-docblock-checker
composer -q global config bin-dir --absolute >> "${GITHUB_PATH}"
- name: phpdoccheck
run: phpdoccheck -d src --skip-classes | ./bin/reviewdog -efm="ERROR %f:%l - %m" -name="phpdoccheck" -reporter=github-check
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}