11name : main
2- on : [ push, pull_request ]
2+ on : [ push, pull_request, merge_group ]
3+ permissions :
4+ contents : read # to fetch code (actions/checkout)
35jobs :
46 test :
57 runs-on : ubuntu-latest
810 experimental :
911 - false
1012 php-version :
11- - ' 7.4'
12- - ' 8.0'
1313 - ' 8.1'
1414 - ' 8.2'
15+ - ' 8.3'
16+ - ' 8.4'
1517
1618 include :
1719 - php-version : ' nightly'
2123
2224 steps :
2325 - 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
2533
2634 - name : Setup PHP, with composer and extensions
2735 uses : shivammathur/setup-php@v2
@@ -32,24 +40,24 @@ jobs:
3240
3341 - name : Get composer cache directory
3442 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
3644
3745 - name : Cache composer dependencies
38- uses : actions/cache@v3
46+ uses : actions/cache@v4
3947 with :
4048 path : ${{ steps.composer-cache.outputs.dir }}
4149 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4250 restore-keys : ${{ runner.os }}-composer-
4351
4452 - name : Delete composer lock file
4553 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' }}
4755 run : |
4856 rm composer.lock
49- echo "::set-output name= flags:: --ignore-platform-reqs"
57+ echo "flags= --ignore-platform-reqs" >> $GITHUB_OUTPUT
5058
5159 - 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 }}
5361
5462 - name : Setup problem matchers for PHP
5563 run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -60,28 +68,47 @@ jobs:
6068 - name : " Run PHPUnit tests (Experimental: ${{ matrix.experimental }})"
6169 env :
6270 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
6491
6592 php-cs-fixer :
6693 runs-on : ubuntu-latest
6794 steps :
6895 - name : Checkout
69- uses : actions/checkout@v3
96+ uses : actions/checkout@v4
7097
7198 - name : Setup PHP, with composer and extensions
7299 uses : shivammathur/setup-php@v2
73100 with :
74- php-version : 7.4
101+ php-version : 8.3
75102 extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
76103 coverage : none
77104 tools : cs2pr
78105
79106 - name : Get composer cache directory
80107 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
82109
83110 - name : Cache composer dependencies
84- uses : actions/cache@v3
111+ uses : actions/cache@v4
85112 with :
86113 path : ${{ steps.composer-cache.outputs.dir }}
87114 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -91,28 +118,28 @@ jobs:
91118 run : composer install --no-progress --prefer-dist --optimize-autoloader
92119
93120 - 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
95122
96123 phpcs :
97124 runs-on : ubuntu-latest
98125 steps :
99126 - name : Checkout
100- uses : actions/checkout@v3
127+ uses : actions/checkout@v4
101128
102129 - name : Setup PHP, with composer and extensions
103130 uses : shivammathur/setup-php@v2
104131 with :
105- php-version : 7.4
132+ php-version : 8.3
106133 extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
107134 coverage : none
108135 tools : cs2pr
109136
110137 - name : Get composer cache directory
111138 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
113140
114141 - name : Cache composer dependencies
115- uses : actions/cache@v3
142+ uses : actions/cache@v4
116143 with :
117144 path : ${{ steps.composer-cache.outputs.dir }}
118145 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -128,22 +155,22 @@ jobs:
128155 runs-on : ubuntu-latest
129156 steps :
130157 - name : Checkout
131- uses : actions/checkout@v3
158+ uses : actions/checkout@v4
132159
133160 - name : Setup PHP, with composer and extensions
134161 uses : shivammathur/setup-php@v2
135162 with :
136- php-version : 7.4
163+ php-version : 8.3
137164 extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
138165 coverage : none
139166 tools : cs2pr
140167
141168 - name : Get composer cache directory
142169 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
144171
145172 - name : Cache composer dependencies
146- uses : actions/cache@v3
173+ uses : actions/cache@v4
147174 with :
148175 path : ${{ steps.composer-cache.outputs.dir }}
149176 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -153,28 +180,28 @@ jobs:
153180 run : composer install --no-progress --prefer-dist --optimize-autoloader
154181
155182 - 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
157184
158185 phpstan :
159186 runs-on : ubuntu-latest
160187 steps :
161188 - name : Checkout
162- uses : actions/checkout@v3
189+ uses : actions/checkout@v4
163190
164191 - name : Setup PHP, with composer and extensions
165192 uses : shivammathur/setup-php@v2
166193 with :
167- php-version : 7.4
194+ php-version : 8.3
168195 extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
169196 coverage : none
170197 tools : cs2pr
171198
172199 - name : Get composer cache directory
173200 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
175202
176203 - name : Cache composer dependencies
177- uses : actions/cache@v3
204+ uses : actions/cache@v4
178205 with :
179206 path : ${{ steps.composer-cache.outputs.dir }}
180207 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -190,21 +217,29 @@ jobs:
190217 runs-on : ubuntu-latest
191218 steps :
192219 - 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
194229
195230 - name : Setup PHP, with composer and extensions
196231 uses : shivammathur/setup-php@v2
197232 with :
198- php-version : 7.4
233+ php-version : 8.3
199234 extensions : ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
200235 coverage : pcov
201236
202237 - name : Get composer cache directory
203238 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
205240
206241 - name : Cache composer dependencies
207- uses : actions/cache@v3
242+ uses : actions/cache@v4
208243 with :
209244 path : ${{ steps.composer-cache.outputs.dir }}
210245 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -216,14 +251,16 @@ jobs:
216251 - name : Coverage
217252 run : |
218253 ./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
221256
222257 release :
258+ permissions :
259+ contents : write # to create a release (actions/create-release)
223260 runs-on : ubuntu-latest
224261 if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
225262 steps :
226- - uses : actions/checkout@v3
263+ - uses : actions/checkout@v4
227264 with :
228265 ref : ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
229266
0 commit comments