Skip to content

Commit c7543e9

Browse files
authored
[CI] Improve static analyser (#20)
* [CI] Improve static analyzer * normalize composer
1 parent 5cca3da commit c7543e9

File tree

2 files changed

+64
-16
lines changed

2 files changed

+64
-16
lines changed

.github/workflows/static.yml

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,80 @@
1-
on: [push, pull_request]
1+
on: [pull_request]
22
name: Static analysis
33

44
jobs:
55
phpstan:
66
name: PHPStan
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-20.04
8+
89
steps:
910
- name: Checkout code
1011
uses: actions/checkout@v2
1112

12-
- name: PHPStan
13-
uses: docker://oskarstark/phpstan-ga
14-
env:
15-
REQUIRE_DEV: true
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
1615
with:
17-
args: analyze --no-progress
16+
php-version: 8.0
17+
coverage: none
18+
tools: phpstan:0.12.92, cs2pr
19+
20+
- name: Download dependencies
21+
uses: ramsey/composer-install@v1
22+
23+
- name: PHPStan
24+
run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr
1825

1926
php-cs-fixer:
2027
name: PHP-CS-Fixer
21-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-20.04
29+
2230
steps:
23-
- uses: actions/checkout@v2
24-
- name: PHP-CS-Fixer
25-
uses: docker://oskarstark/php-cs-fixer-ga
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
2636
with:
27-
args: --dry-run --diff-format udiff
37+
php-version: 8.0
38+
coverage: none
39+
tools: php-cs-fixer:2.19.0, cs2pr
40+
41+
- name: PHP-CS-Fixer
42+
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
2843

2944
psalm:
3045
name: Psalm
31-
runs-on: ubuntu-latest
46+
runs-on: ubuntu-20.04
3247
steps:
3348
- name: Checkout code
3449
uses: actions/checkout@v2
3550

51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: 8.0
55+
coverage: none
56+
tools: vimeo/psalm:4.8.1
57+
58+
- name: Download dependencies
59+
uses: ramsey/composer-install@v1
60+
3661
- name: Psalm
37-
uses: docker://vimeo/psalm-github-actions
62+
run: psalm --no-progress --output-format=github
63+
64+
composer-normalize:
65+
name: Composer Normalize
66+
runs-on: ubuntu-20.04
67+
68+
steps:
69+
- name: Setup PHP
70+
uses: shivammathur/setup-php@v2
71+
with:
72+
php-version: 8.0
73+
coverage: none
74+
tools: composer-normalize
75+
76+
- name: Checkout code
77+
uses: actions/checkout@v2
78+
79+
- name: Normalize
80+
run: composer-normalize --dry-run

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"name": "nyholm/nsa",
33
"description": "See everything and do whatever you want. No privacy rule will stop us. Used in tests, debugging and fixtures to access properties and methods.",
4+
"keywords": [
5+
"reflection",
6+
"test",
7+
"debug",
8+
"fixture"
9+
],
10+
"homepage": "https://tnyholm.se",
411
"license": "MIT",
5-
"keywords": ["reflection", "test", "debug", "fixture"],
6-
"homepage": "http://tnyholm.se",
712
"authors": [
813
{
914
"name": "Tobias Nyholm",

0 commit comments

Comments
 (0)