Skip to content

Commit 990433c

Browse files
Split workflows and add PHPStan
1 parent 280c23e commit 990433c

File tree

5 files changed

+102
-53
lines changed

5 files changed

+102
-53
lines changed

.github/workflows/analyse.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: analyse
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
analyse:
11+
name: "Static analysis (PHP ${{ matrix.php-version }})"
12+
runs-on: "ubuntu-22.04"
13+
continue-on-error: true
14+
15+
strategy:
16+
matrix:
17+
php-version: [ "8.1" ]
18+
19+
env:
20+
COMPOSER_VERSION: 2
21+
COVERAGE_DRIVER: xdebug
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v3
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php-version }}
31+
tools: composer:${{ env.COMPOSER_VERSION }}
32+
coverage: none
33+
34+
- name: Install dependencies
35+
run: composer install --no-interaction --prefer-dist --no-progress
36+
37+
- name: Execute type checking
38+
run: php vendor/bin/phpstan

.github/workflows/lint.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
lint:
10+
name: "Linting (PHP ${{ matrix.php-version }})"
11+
runs-on: "ubuntu-22.04"
12+
continue-on-error: true
13+
14+
strategy:
15+
matrix:
16+
php-version: [ "8.1" ]
17+
18+
env:
19+
COMPOSER_VERSION: 2
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v3
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
tools: composer:${{ env.COMPOSER_VERSION }}
30+
coverage: none
31+
32+
- name: Install dependencies
33+
run: composer install --no-interaction --prefer-dist --no-progress
34+
35+
- name: Run PHP-CS-Fixer
36+
run: php vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php --verbose --dry-run
37+
38+
39+
validate:
40+
name: "Validating composer.json"
41+
runs-on: "ubuntu-22.04"
42+
continue-on-error: true
43+
44+
env:
45+
COMPOSER_VERSION: 2
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v3
50+
51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
tools: composer:${{ env.COMPOSER_VERSION }}
55+
56+
- name: Run composer validate
57+
run: composer validate

.github/workflows/main.yml renamed to .github/workflows/test.yml

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
name: main
1+
name: test
22

33
on:
44
push:
5-
branches: [ main ]
65
pull_request:
76
branches: [ main ]
87
workflow_dispatch:
@@ -94,53 +93,3 @@ jobs:
9493

9594
- name: Run integration tests
9695
run: php vendor/bin/phpunit --testsuite integration --no-coverage
97-
98-
99-
lint:
100-
name: "Linting (PHP ${{ matrix.php-version }})"
101-
runs-on: "ubuntu-22.04"
102-
continue-on-error: true
103-
104-
strategy:
105-
matrix:
106-
php-version: [ "8.1" ]
107-
108-
env:
109-
COMPOSER_VERSION: 2
110-
111-
steps:
112-
- name: Checkout repository
113-
uses: actions/checkout@v3
114-
115-
- name: Setup PHP
116-
uses: shivammathur/setup-php@v2
117-
with:
118-
php-version: ${{ matrix.php-version }}
119-
tools: composer:${{ env.COMPOSER_VERSION }}
120-
121-
- name: Install dependencies
122-
run: composer install --no-interaction --prefer-dist --no-progress
123-
124-
- name: Run PHP-CS-Fixer
125-
run: php vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php --verbose --dry-run
126-
127-
128-
validate:
129-
name: "Validating (composer.json)"
130-
runs-on: "ubuntu-22.04"
131-
continue-on-error: true
132-
133-
env:
134-
COMPOSER_VERSION: 2
135-
136-
steps:
137-
- name: Checkout repository
138-
uses: actions/checkout@v3
139-
140-
- name: Setup PHP
141-
uses: shivammathur/setup-php@v2
142-
with:
143-
tools: composer:${{ env.COMPOSER_VERSION }}
144-
145-
- name: Run composer validate
146-
run: composer validate

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"infection/infection": "^0.25.5",
5656
"friendsofphp/php-cs-fixer": "^3.0",
5757
"rregeer/phpunit-coverage-check": "^0.3.1",
58-
"stefanak-michal/bolt": "^4.1"
58+
"stefanak-michal/bolt": "^4.1",
59+
"phpstan/phpstan": "^1.8"
5960
},
6061
"autoload": {
6162
"psr-4": {

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
paths:
3+
- src
4+
level: 7

0 commit comments

Comments
 (0)