Skip to content

Commit 4ac80ae

Browse files
Add support for PHP 8.5
1 parent 0c18f54 commit 4ac80ae

2 files changed

Lines changed: 66 additions & 16 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212

13-
vlucas-phpdotenv-php84-83-82-81-80:
13+
vlucas-phpdotenv-php85-84-83-82-81-80:
1414

1515
name: "PHP${{ matrix.php }} vlucas/phpdotenv ${{ matrix.vlucas-phpdotenv }} ${{ matrix.os-title }} ${{ matrix.dependency-prefer-title }}"
1616
runs-on: "${{ matrix.os }}"
@@ -20,10 +20,13 @@ jobs:
2020
fail-fast: true
2121
matrix:
2222
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
23-
php: [ "8.4", "8.3", "8.2", "8.1", "8.0" ]
23+
php: [ "8.5", "8.4", "8.3", "8.2", "8.1", "8.0" ]
2424
vlucas-phpdotenv: [ "^5.0", "^4.1.5", "^3.6.4", "^2.0", "^1.1.0" ]
2525
dependency-prefer: [ "prefer-stable", "prefer-lowest" ]
2626
include:
27+
- php: "8.5"
28+
phpunit: "^11.1"
29+
phpunit-config-file: "phpunit.github-actions.xml.dist"
2730
- php: "8.4"
2831
phpunit: "^11.1"
2932
phpunit-config-file: "phpunit.github-actions.xml.dist"
@@ -58,7 +61,7 @@ jobs:
5861
steps:
5962

6063
- name: "Checkout code"
61-
uses: "actions/checkout@v4"
64+
uses: "actions/checkout@v6"
6265

6366
- name: "Setup PHP"
6467
uses: "shivammathur/setup-php@v2"
@@ -80,11 +83,22 @@ jobs:
8083
run: |
8184
echo "composer_cache_dir=$(composer config cache-files-dir)">> "$GITHUB_OUTPUT"
8285
86+
- name: "Compute composer.json hash"
87+
id: "composer-hash"
88+
shell: "bash" # make sure this step works on Windows - bash syntax is used
89+
run: |
90+
# GitHub's hashFiles() tool has regression bug on MacOS - https://github.com/actions/runner-images/issues/13341
91+
# if replacing, fix the "$" and the "{ {" - the GitHub running picks it up and runs it before the step is run
92+
#COMPOSER_HASH="${ { hashFiles('composer.json') }}"
93+
# Use md5_file() instead
94+
COMPOSER_HASH="$(php -r 'echo md5_file("composer.json");')"
95+
echo "value=$COMPOSER_HASH" >> "$GITHUB_OUTPUT"
96+
8397
- name: "Cache composer's cache directory"
8498
uses: "actions/cache@v4"
8599
with:
86100
path: "${{ steps.composer-cache.outputs.composer_cache_dir }}"
87-
key: "[${{ matrix.os }}][php-${{ matrix.php }}][vlucas/phpdotenv-${{ matrix.vlucas-phpdotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ hashFiles('composer.json') }}]"
101+
key: "[${{ matrix.os }}][php-${{ matrix.php }}][vlucas/phpdotenv-${{ matrix.vlucas-phpdotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ steps.composer-hash.outputs.value }}]"
88102

89103
- name: "Install dependencies"
90104
uses: "nick-fields/retry@v3"
@@ -155,7 +169,7 @@ jobs:
155169
steps:
156170

157171
- name: "Checkout code"
158-
uses: "actions/checkout@v4"
172+
uses: "actions/checkout@v6"
159173

160174
- name: "Setup PHP"
161175
uses: "shivammathur/setup-php@v2"
@@ -177,11 +191,22 @@ jobs:
177191
run: |
178192
echo "composer_cache_dir=$(composer config cache-files-dir)">> "$GITHUB_OUTPUT"
179193
194+
- name: "Compute composer.json hash"
195+
id: "composer-hash"
196+
shell: "bash" # make sure this step works on Windows - bash syntax is used
197+
run: |
198+
# GitHub's hashFiles() tool has regression bug on MacOS - https://github.com/actions/runner-images/issues/13341
199+
# if replacing, fix the "$" and the "{ {" - the GitHub running picks it up and runs it before the step is run
200+
#COMPOSER_HASH="${ { hashFiles('composer.json') }}"
201+
# Use md5_file() instead
202+
COMPOSER_HASH="$(php -r 'echo md5_file("composer.json");')"
203+
echo "value=$COMPOSER_HASH" >> "$GITHUB_OUTPUT"
204+
180205
- name: "Cache composer's cache directory"
181206
uses: "actions/cache@v4"
182207
with:
183208
path: "${{ steps.composer-cache.outputs.composer_cache_dir }}"
184-
key: "[${{ matrix.os }}][php-${{ matrix.php }}][vlucas/phpdotenv-${{ matrix.vlucas-phpdotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ hashFiles('composer.json') }}]"
209+
key: "[${{ matrix.os }}][php-${{ matrix.php }}][vlucas/phpdotenv-${{ matrix.vlucas-phpdotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ steps.composer-hash.outputs.value }}]"
185210

186211
- name: "Install dependencies"
187212
uses: "nick-fields/retry@v3"
@@ -203,7 +228,7 @@ jobs:
203228

204229

205230

206-
symfony-dotenv-php84-83-82-81-80:
231+
symfony-dotenv-php85-84-83-82-81-80:
207232

208233
name: "PHP${{ matrix.php }} symfony/dotenv ${{ matrix.symfony-dotenv }} ${{ matrix.os-title }} ${{ matrix.dependency-prefer-title }}"
209234
runs-on: "${{ matrix.os }}"
@@ -213,10 +238,13 @@ jobs:
213238
fail-fast: true
214239
matrix:
215240
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
216-
php: [ "8.4", "8.3", "8.2", "8.1", "8.0" ]
241+
php: [ "8.5", "8.4", "8.3", "8.2", "8.1", "8.0" ]
217242
symfony-dotenv: [ "^7.0", "^6.0", "^5.0", "^4.0", "^3.3" ]
218243
dependency-prefer: [ "prefer-stable", "prefer-lowest" ]
219244
include:
245+
- php: "8.5"
246+
phpunit: "^11.0"
247+
phpunit-config-file: "phpunit.github-actions.xml.dist"
220248
- php: "8.4"
221249
phpunit: "^11.0"
222250
phpunit-config-file: "phpunit.github-actions.xml.dist"
@@ -257,7 +285,7 @@ jobs:
257285
steps:
258286

259287
- name: "Checkout code"
260-
uses: "actions/checkout@v4"
288+
uses: "actions/checkout@v6"
261289

262290
- name: "Setup PHP"
263291
uses: "shivammathur/setup-php@v2"
@@ -279,11 +307,22 @@ jobs:
279307
run: |
280308
echo "composer_cache_dir=$(composer config cache-files-dir)">> "$GITHUB_OUTPUT"
281309
310+
- name: "Compute composer.json hash"
311+
id: "composer-hash"
312+
shell: "bash" # make sure this step works on Windows - bash syntax is used
313+
run: |
314+
# GitHub's hashFiles() tool has regression bug on MacOS - https://github.com/actions/runner-images/issues/13341
315+
# if replacing, fix the "$" and the "{ {" - the GitHub running picks it up and runs it before the step is run
316+
#COMPOSER_HASH="${ { hashFiles('composer.json') }}"
317+
# Use md5_file() instead
318+
COMPOSER_HASH="$(php -r 'echo md5_file("composer.json");')"
319+
echo "value=$COMPOSER_HASH" >> "$GITHUB_OUTPUT"
320+
282321
- name: "Cache composer's cache directory"
283322
uses: "actions/cache@v4"
284323
with:
285324
path: "${{ steps.composer-cache.outputs.composer_cache_dir }}"
286-
key: "[${{ matrix.os }}][php-${{ matrix.php }}][symfony/dotenv-${{ matrix.symfony-dotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ hashFiles('composer.json') }}]"
325+
key: "[${{ matrix.os }}][php-${{ matrix.php }}][symfony/dotenv-${{ matrix.symfony-dotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ steps.composer-hash.outputs.value }}]"
287326

288327
- name: "Install dependencies"
289328
uses: "nick-fields/retry@v3"
@@ -378,7 +417,7 @@ jobs:
378417
steps:
379418

380419
- name: "Checkout code"
381-
uses: "actions/checkout@v4"
420+
uses: "actions/checkout@v6"
382421

383422
- name: "Setup PHP"
384423
uses: "shivammathur/setup-php@v2"
@@ -400,11 +439,22 @@ jobs:
400439
run: |
401440
echo "composer_cache_dir=$(composer config cache-files-dir)">> "$GITHUB_OUTPUT"
402441
442+
- name: "Compute composer.json hash"
443+
id: "composer-hash"
444+
shell: "bash" # make sure this step works on Windows - bash syntax is used
445+
run: |
446+
# GitHub's hashFiles() tool has regression bug on MacOS - https://github.com/actions/runner-images/issues/13341
447+
# if replacing, fix the "$" and the "{ {" - the GitHub running picks it up and runs it before the step is run
448+
#COMPOSER_HASH="${ { hashFiles('composer.json') }}"
449+
# Use md5_file() instead
450+
COMPOSER_HASH="$(php -r 'echo md5_file("composer.json");')"
451+
echo "value=$COMPOSER_HASH" >> "$GITHUB_OUTPUT"
452+
403453
- name: "Cache composer's cache directory"
404454
uses: "actions/cache@v4"
405455
with:
406456
path: "${{ steps.composer-cache.outputs.composer_cache_dir }}"
407-
key: "[${{ matrix.os }}][php-${{ matrix.php }}][symfony/dotenv-${{ matrix.symfony-dotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ hashFiles('composer.json') }}]"
457+
key: "[${{ matrix.os }}][php-${{ matrix.php }}][symfony/dotenv-${{ matrix.symfony-dotenv }}][${{ matrix.dependency-prefer }}][composer.json-${{ steps.composer-hash.outputs.value }}]"
408458

409459
- name: "Install dependencies"
410460
uses: "nick-fields/retry@v3"

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
}
2525
],
2626
"require": {
27-
"php": "7.0.* | 7.1.* | 7.2.* | 7.3.* | 7.4.* | 8.0.* | 8.1.* | 8.2.* | 8.3.* | 8.4.*",
27+
"php": "7.0.* | 7.1.* | 7.2.* | 7.3.* | 7.4.* | 8.0.* | 8.1.* | 8.2.* | 8.3.* | 8.4.* | 8.5.*",
2828
"ext-mbstring": "*"
2929
},
3030
"require-dev": {
31-
"infection/infection": "^0.1 | ^0.2 | ^0.3 | ^0.4 | ^0.5 | ^0.6 | ^0.7 | ^0.8 | ^0.9 | ^0.10 | ^0.11 | ^0.12 | ^0.13 | ^0.14 | ^0.15 | ^0.16 | ^0.17 | ^0.18 | ^0.19 | ^0.20 | ^0.21 | ^0.22 | ^0.23 | ^0.24 | ^0.25 | ^0.26 | ^0.27 | ^0.28 | ^0.29",
31+
"infection/infection": "^0.1 | ^0.2 | ^0.3 | ^0.4 | ^0.5 | ^0.6 | ^0.7 | ^0.8 | ^0.9 | ^0.10 | ^0.11 | ^0.12 | ^0.13 | ^0.14 | ^0.15 | ^0.16 | ^0.17 | ^0.18 | ^0.19 | ^0.20 | ^0.21 | ^0.22 | ^0.23 | ^0.24 | ^0.25 | ^0.26 | ^0.27 | ^0.28 | ^0.29 | ^0.30 | ^0.31",
3232
"phpstan/phpstan": "^0.9 | ^0.10 | ^0.11 | ^0.12 | ^1.0 | ^2.0",
3333
"phpstan/phpstan-strict-rules": "^0.9 | ^0.10 | ^0.11 | ^0.12 | ^1.0 | ^2.0",
34-
"phpunit/phpunit": "~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.4 | ^9.0 | ^10.0 | ^11.0",
35-
"squizlabs/php_codesniffer": "^3.11.2",
34+
"phpunit/phpunit": "~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.4 | ^9.0 | ^10.0 | ^11.0 | ^12.0",
35+
"squizlabs/php_codesniffer": "^3.11.2 | ^4.0",
3636
"vlucas/phpdotenv": "^1.1.0 | ^2.0 | ^3.0 | ^4.0 | ^5.0"
3737
},
3838
"autoload": {

0 commit comments

Comments
 (0)