1
1
name : main
2
- on : [ push, pull_request ]
2
+ on : [ push, pull_request, merge_group ]
3
+ permissions :
4
+ contents : read # to fetch code (actions/checkout)
3
5
jobs :
4
6
test :
5
7
runs-on : ubuntu-latest
8
10
experimental :
9
11
- false
10
12
php-version :
11
- - ' 7.4'
12
- - ' 8.0'
13
13
- ' 8.1'
14
14
- ' 8.2'
15
+ - ' 8.3'
16
+ - ' 8.4'
15
17
16
18
include :
17
19
- php-version : ' nightly'
21
23
22
24
steps :
23
25
- name : Checkout
24
- uses : actions/checkout@v3
26
+ uses : actions/checkout@v4
27
+
28
+ - name : Install locales
29
+ run : sudo apt-get update && sudo apt-get install -y language-pack-fr language-pack-de
30
+
31
+ - name : Install single-byte locale
32
+ run : sudo sed -i -e 's/# de_DE@euro/de_DE@euro/g' /etc/locale.gen && sudo locale-gen de_DE@euro
25
33
26
34
- name : Setup PHP, with composer and extensions
27
35
uses : shivammathur/setup-php@v2
@@ -32,24 +40,24 @@ jobs:
32
40
33
41
- name : Get composer cache directory
34
42
id : composer-cache
35
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
43
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
36
44
37
45
- name : Cache composer dependencies
38
- uses : actions/cache@v3
46
+ uses : actions/cache@v4
39
47
with :
40
48
path : ${{ steps.composer-cache.outputs.dir }}
41
49
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
42
50
restore-keys : ${{ runner.os }}-composer-
43
51
44
52
- name : Delete composer lock file
45
53
id : composer-lock
46
- if : ${{ matrix.php-version == '8.1' || matrix.php-version == '8.2' || matrix.php-version == ' nightly' }}
54
+ if : ${{ matrix.php-version == 'nightly' }}
47
55
run : |
48
56
rm composer.lock
49
- echo "::set-output name= flags:: --ignore-platform-reqs"
57
+ echo "flags= --ignore-platform-reqs" >> $GITHUB_OUTPUT
50
58
51
59
- name : Install dependencies
52
- run : composer update --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }}
60
+ run : composer install --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }}
53
61
54
62
- name : Setup problem matchers for PHP
55
63
run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -60,28 +68,47 @@ jobs:
60
68
- name : " Run PHPUnit tests (Experimental: ${{ matrix.experimental }})"
61
69
env :
62
70
FAILURE_ACTION : " ${{ matrix.experimental == true }}"
63
- run : vendor/bin/phpunit --verbose || $FAILURE_ACTION
71
+ run : vendor/bin/phpunit --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings || $FAILURE_ACTION
72
+
73
+ phpdoc-types :
74
+ runs-on : ubuntu-latest
75
+ steps :
76
+ - name : Checkout
77
+ uses : actions/checkout@v4
78
+ with :
79
+ fetch-depth : 2
80
+
81
+ - name : Setup PHP, with composer and extensions
82
+ uses : shivammathur/setup-php@v2
83
+ with :
84
+ php-version : 8.3
85
+ extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
86
+ coverage : none
87
+
88
+ # This is non-ideal because it only checks for the last commit of the PR, not all of them, but better than nothing
89
+ - name : Check PHPDoc types
90
+ run : ./bin/check-phpdoc-types
64
91
65
92
php-cs-fixer :
66
93
runs-on : ubuntu-latest
67
94
steps :
68
95
- name : Checkout
69
- uses : actions/checkout@v3
96
+ uses : actions/checkout@v4
70
97
71
98
- name : Setup PHP, with composer and extensions
72
99
uses : shivammathur/setup-php@v2
73
100
with :
74
- php-version : 7.4
101
+ php-version : 8.3
75
102
extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
76
103
coverage : none
77
104
tools : cs2pr
78
105
79
106
- name : Get composer cache directory
80
107
id : composer-cache
81
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
108
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
82
109
83
110
- name : Cache composer dependencies
84
- uses : actions/cache@v3
111
+ uses : actions/cache@v4
85
112
with :
86
113
path : ${{ steps.composer-cache.outputs.dir }}
87
114
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -91,28 +118,28 @@ jobs:
91
118
run : composer install --no-progress --prefer-dist --optimize-autoloader
92
119
93
120
- name : Code style with PHP-CS-Fixer
94
- run : ./vendor/bin/php-cs-fixer fix --format=checkstyle | cs2pr
121
+ run : ( ./vendor/bin/php-cs-fixer fix --dry-run -- format=checkstyle | cs2pr) || ./vendor/bin/php-cs-fixer fix --diff --dry-run
95
122
96
123
phpcs :
97
124
runs-on : ubuntu-latest
98
125
steps :
99
126
- name : Checkout
100
- uses : actions/checkout@v3
127
+ uses : actions/checkout@v4
101
128
102
129
- name : Setup PHP, with composer and extensions
103
130
uses : shivammathur/setup-php@v2
104
131
with :
105
- php-version : 7.4
132
+ php-version : 8.3
106
133
extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
107
134
coverage : none
108
135
tools : cs2pr
109
136
110
137
- name : Get composer cache directory
111
138
id : composer-cache
112
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
139
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
113
140
114
141
- name : Cache composer dependencies
115
- uses : actions/cache@v3
142
+ uses : actions/cache@v4
116
143
with :
117
144
path : ${{ steps.composer-cache.outputs.dir }}
118
145
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -128,22 +155,22 @@ jobs:
128
155
runs-on : ubuntu-latest
129
156
steps :
130
157
- name : Checkout
131
- uses : actions/checkout@v3
158
+ uses : actions/checkout@v4
132
159
133
160
- name : Setup PHP, with composer and extensions
134
161
uses : shivammathur/setup-php@v2
135
162
with :
136
- php-version : 7.4
163
+ php-version : 8.3
137
164
extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
138
165
coverage : none
139
166
tools : cs2pr
140
167
141
168
- name : Get composer cache directory
142
169
id : composer-cache
143
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
170
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
144
171
145
172
- name : Cache composer dependencies
146
- uses : actions/cache@v3
173
+ uses : actions/cache@v4
147
174
with :
148
175
path : ${{ steps.composer-cache.outputs.dir }}
149
176
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -153,28 +180,28 @@ jobs:
153
180
run : composer install --no-progress --prefer-dist --optimize-autoloader
154
181
155
182
- name : Code Version Compatibility check with PHP_CodeSniffer
156
- run : ./vendor/bin/phpcs -q --report-width=200 --report=summary,full src/ --standard=PHPCompatibility --runtime-set testVersion 7.4-
183
+ run : ./vendor/bin/phpcs -q --report-width=200 --report=summary,full src/ --standard=PHPCompatibility --runtime-set testVersion 8.1- --exclude=PHPCompatibility.Variables.ForbiddenThisUseContexts
157
184
158
185
phpstan :
159
186
runs-on : ubuntu-latest
160
187
steps :
161
188
- name : Checkout
162
- uses : actions/checkout@v3
189
+ uses : actions/checkout@v4
163
190
164
191
- name : Setup PHP, with composer and extensions
165
192
uses : shivammathur/setup-php@v2
166
193
with :
167
- php-version : 7.4
194
+ php-version : 8.3
168
195
extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
169
196
coverage : none
170
197
tools : cs2pr
171
198
172
199
- name : Get composer cache directory
173
200
id : composer-cache
174
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
201
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
175
202
176
203
- name : Cache composer dependencies
177
- uses : actions/cache@v3
204
+ uses : actions/cache@v4
178
205
with :
179
206
path : ${{ steps.composer-cache.outputs.dir }}
180
207
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -190,21 +217,29 @@ jobs:
190
217
runs-on : ubuntu-latest
191
218
steps :
192
219
- name : Checkout
193
- uses : actions/checkout@v3
220
+ uses : actions/checkout@v4
221
+ with :
222
+ fetch-depth : 0
223
+
224
+ - name : Install locales
225
+ run : sudo apt-get update && sudo apt-get install -y language-pack-fr language-pack-de
226
+
227
+ - name : Install single-byte locale
228
+ run : sudo sed -i -e 's/# de_DE@euro/de_DE@euro/g' /etc/locale.gen && sudo locale-gen de_DE@euro
194
229
195
230
- name : Setup PHP, with composer and extensions
196
231
uses : shivammathur/setup-php@v2
197
232
with :
198
- php-version : 7.4
233
+ php-version : 8.3
199
234
extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
200
235
coverage : pcov
201
236
202
237
- name : Get composer cache directory
203
238
id : composer-cache
204
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
239
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
205
240
206
241
- name : Cache composer dependencies
207
- uses : actions/cache@v3
242
+ uses : actions/cache@v4
208
243
with :
209
244
path : ${{ steps.composer-cache.outputs.dir }}
210
245
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -216,14 +251,16 @@ jobs:
216
251
- name : Coverage
217
252
run : |
218
253
./vendor/bin/phpunit --coverage-clover coverage-clover.xml
219
- curl -LO https:// scrutinizer-ci.com /ocular.phar
220
- php ocular.phar code-coverage:upload --format=php-clover coverage-clover.xml
254
+ composer global require scrutinizer/ocular
255
+ ~/.composer/vendor/bin/ocular code-coverage:upload --format=php-clover coverage-clover.xml
221
256
222
257
release :
258
+ permissions :
259
+ contents : write # to create a release (actions/create-release)
223
260
runs-on : ubuntu-latest
224
261
if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
225
262
steps :
226
- - uses : actions/checkout@v3
263
+ - uses : actions/checkout@v4
227
264
with :
228
265
ref : ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
229
266
0 commit comments