-
-
Notifications
You must be signed in to change notification settings - Fork 22
213 lines (166 loc) · 6.06 KB
/
ci.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
on:
push:
branches:
- master
pull_request:
name: CI
env:
REQUIRED_PHP_EXTENSIONS: "ctype, filter, hash, iconv"
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.27.1"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
- name: "Composer install"
uses: "ramsey/composer-install@v2"
- name: "Run PHPStan"
run: vendor/bin/phpstan analyse -c phpstan.neon.dist
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '8.2'
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: Install PHP with extensions
uses: shivammathur/setup-php@2.27.1
with:
coverage: "none"
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: "Composer install"
uses: "ramsey/composer-install@2.2.0"
with:
composer-options: "--prefer-dist"
- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --diff --verbose"
composer-normalize:
name: composer normalize
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '8.2'
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: Install PHP with extensions
uses: shivammathur/setup-php@2.27.1
with:
coverage: "none"
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: "Composer install"
uses: "ramsey/composer-install@2.2.0"
with:
composer-options: "--no-scripts"
- name: "composer normalize"
run: "composer normalize"
tests:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.27.1"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
- name: "Composer install"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--no-scripts"
- name: "PHPUnit version"
run: vendor/bin/phpunit --version
- name: "Run tests"
run: vendor/bin/phpunit
refactoring:
name: "Refactoring"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "8.2"
steps:
# workaround for missing secret in fork PRs - see /~https://github.com/actions/checkout/issues/298
# see /~https://github.com/rectorphp/rector/commit/d395e1c28b8e6a56711dcc2e10490a82965850e4
- if: github.actor != 'dependabot[bot]'
name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: "${{ github.head_ref }}"
# Must be used to be able to commit changed files
token: "${{ secrets.GITHUB_TOKEN }}"
# in forks, the token is not available - so we cannot use it
- if: github.actor == 'dependabot[bot]'
name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: "${{ github.head_ref }}"
-
name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.27.1"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
-
name: "Composer instal"
uses: "ramsey/composer-install@2.2.0"
with:
composer-options: "--no-scripts"
-
name: "Run rector/rector"
run: "vendor/bin/rector process --config rector.php"
dependency-analysis:
name: "Dependency Analysis"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "8.2"
steps:
-
name: "Checkout"
uses: "actions/checkout@v4"
-
name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.27.1"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
-
name: "Composer install"
uses: "ramsey/composer-install@2.2.0"
-
name: "Check for unused dependencies"
run: 'vendor/bin/composer-unused --no-progress --output-format=github | grep -e "^::error" && exit 1 || :'
-
name: "Check for implicit dependencies"
run: "tools/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json composer.json"