setup-php 2.35.5 → 2.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +103 -90
  2. package/lib/core.d.ts +8 -0
  3. package/lib/core.js +55 -0
  4. package/lib/core.js.map +1 -0
  5. package/lib/extensions.js +17 -16
  6. package/lib/extensions.js.map +1 -1
  7. package/lib/fetch.js +25 -70
  8. package/lib/fetch.js.map +1 -1
  9. package/lib/install.js +1 -1
  10. package/lib/install.js.map +1 -1
  11. package/lib/tools.d.ts +48 -21
  12. package/lib/tools.js +175 -154
  13. package/lib/tools.js.map +1 -1
  14. package/lib/utils.js +5 -5
  15. package/lib/utils.js.map +1 -1
  16. package/package.json +23 -22
  17. package/src/configs/brew_extensions +20 -0
  18. package/src/configs/darwin_libs +22 -0
  19. package/src/configs/linux_libs +22 -0
  20. package/src/configs/php-versions.json +5 -4
  21. package/src/configs/tools.json +2 -1
  22. package/src/core.ts +112 -0
  23. package/src/extensions.ts +39 -32
  24. package/src/fetch.ts +28 -42
  25. package/src/install.ts +1 -1
  26. package/src/scripts/darwin.sh +45 -19
  27. package/src/scripts/extensions/add_extensions.sh +5 -3
  28. package/src/scripts/extensions/couchbase.sh +13 -2
  29. package/src/scripts/extensions/firebird.sh +6 -23
  30. package/src/scripts/extensions/gearman.sh +3 -1
  31. package/src/scripts/extensions/http.ps1 +7 -5
  32. package/src/scripts/extensions/ibm.ps1 +56 -0
  33. package/src/scripts/extensions/ibm.sh +106 -0
  34. package/src/scripts/extensions/oci.sh +2 -1
  35. package/src/scripts/extensions/patches/amqp.sh +5 -0
  36. package/src/scripts/extensions/patches/common.sh +31 -8
  37. package/src/scripts/extensions/patches/geos.sh +1 -5
  38. package/src/scripts/extensions/patches/pdo_oci.sh +3 -0
  39. package/src/scripts/extensions/patches/pdo_sqlsrv.sh +5 -0
  40. package/src/scripts/extensions/patches/phpize.sh +2 -1
  41. package/src/scripts/extensions/relay.sh +25 -35
  42. package/src/scripts/extensions/source.sh +26 -6
  43. package/src/scripts/extensions/sqlsrv.ps1 +2 -0
  44. package/src/scripts/extensions/sqlsrv.sh +2 -0
  45. package/src/scripts/linux.sh +50 -10
  46. package/src/scripts/tools/add_tools.ps1 +52 -26
  47. package/src/scripts/tools/add_tools.sh +41 -19
  48. package/src/scripts/tools/blackfire.sh +1 -1
  49. package/src/scripts/tools/brew.sh +130 -0
  50. package/src/scripts/tools/grpc_php_plugin.sh +2 -2
  51. package/src/scripts/tools/ppa.sh +201 -28
  52. package/src/scripts/tools/symfony.ps1 +28 -14
  53. package/src/scripts/tools/symfony.sh +34 -31
  54. package/src/scripts/unix.sh +8 -4
  55. package/src/scripts/win32.ps1 +9 -4
  56. package/src/tools.ts +312 -203
  57. package/src/utils.ts +6 -7
  58. package/src/scripts/extensions/patches/gearman.sh +0 -5
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  <a href="https://github.com/shivammathur/setup-php" title="GitHub action to setup PHP"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a>
11
11
  <a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://img.shields.io/codecov/c/github/shivammathur/setup-php?logo=codecov"></a>
12
12
  <a href="https://github.com/shivammathur/setup-php/blob/main/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
13
- <a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.5-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
13
+ <a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.6-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
14
14
  </p>
15
15
  <p align="center">
16
16
  <a href="https://reddit.com/r/setup_php" title="setup-php reddit"><img alt="setup-php reddit" src="https://img.shields.io/badge/reddit-join-FF5700?logo=reddit&logoColor=FF5700&labelColor=555555"></a>
@@ -68,19 +68,19 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
68
68
 
69
69
  ### GitHub-Hosted Runners
70
70
 
71
- | Virtual environment | Arch | YAML workflow label | Pre-installed PHP |
72
- |---------------------|---------|------------------------------------|------------------------|
73
- | Ubuntu 24.04 | x86_64 | `ubuntu-latest` or `ubuntu-24.04` | `PHP 8.3` |
74
- | Ubuntu 22.04 | x86_64 | `ubuntu-22.04` | `PHP 8.1` |
75
- | Ubuntu 24.04 | aarch64 | `ubuntu-24.04-arm` | `PHP 8.3` |
76
- | Ubuntu 22.04 | aarch64 | `ubuntu-22.04-arm` | `PHP 8.1` |
77
- | Windows Server 2025 | x64 | `windows-2025` | `PHP 8.3` |
78
- | Windows Server 2022 | x64 | `windows-latest` or `windows-2022` | `PHP 8.3` |
79
- | Windows Server 2019 | x64 | `windows-2019` | `PHP 8.3` |
80
- | macOS Tahoe 26.x | arm64 | `macos-26` | - |
81
- | macOS Sequoia 15.x | arm64 | `macos-latest` or `macos-15` | - |
82
- | macOS Sonoma 14.x | arm64 | `macos-14` | - |
83
- | macOS Ventura 13.x | x86_64 | `macos-13` | `PHP 8.3` |
71
+ | Virtual environment | Arch | YAML workflow label | Pre-installed PHP |
72
+ |---------------------|---------|------------------------------------|-------------------|
73
+ | Ubuntu 24.04 | x86_64 | `ubuntu-latest` or `ubuntu-24.04` | `PHP 8.3` |
74
+ | Ubuntu 22.04 | x86_64 | `ubuntu-22.04` | `PHP 8.1` |
75
+ | Ubuntu 24.04 | aarch64 | `ubuntu-24.04-arm` | `PHP 8.3` |
76
+ | Ubuntu 22.04 | aarch64 | `ubuntu-22.04-arm` | `PHP 8.1` |
77
+ | Windows Server 2025 | x64 | `windows-2025` | `PHP 8.5` |
78
+ | Windows Server 2022 | x64 | `windows-latest` or `windows-2022` | `PHP 8.5` |
79
+ | macOS Tahoe 26.x | arm64 | `macos-26` | - |
80
+ | macOS Sequoia 15.x | arm64 | `macos-latest` or `macos-15` | - |
81
+ | macOS Sonoma 14.x | arm64 | `macos-14` | - |
82
+ | macOS Tahoe 26.x | x86_64 | `macos-26-intel` | `PHP 8.5` |
83
+ | macOS Sequoia 15.x | x86_64 | `macos-15-intel` | `PHP 8.5` |
84
84
 
85
85
  ### Self-Hosted Runners
86
86
 
@@ -88,6 +88,7 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
88
88
  |----------------------------------|----------------------------|
89
89
  | Ubuntu 24.04 | `self-hosted` or `Linux` |
90
90
  | Ubuntu 22.04 | `self-hosted` or `Linux` |
91
+ | Debian 13 | `self-hosted` or `Linux` |
91
92
  | Debian 12 | `self-hosted` or `Linux` |
92
93
  | Debian 11 | `self-hosted` or `Linux` |
93
94
  | Windows 7 and newer | `self-hosted` or `Windows` |
@@ -95,7 +96,6 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
95
96
  | macOS Tahoe 26.x x86_64/arm64 | `self-hosted` or `macOS` |
96
97
  | macOS Sequoia 15.x x86_64/arm64 | `self-hosted` or `macOS` |
97
98
  | macOS Sonoma 14.x x86_64/arm64 | `self-hosted` or `macOS` |
98
- | macOS Ventura 13.x x86_64/arm64 | `self-hosted` or `macOS` |
99
99
 
100
100
  - Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
101
101
  - Operating systems based on the above Ubuntu and Debian versions are also supported on best effort basis.
@@ -103,11 +103,11 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
103
103
 
104
104
  ## :tada: PHP Support
105
105
 
106
- On all supported OS/Platforms the following PHP versions can be set up as per the runner.
106
+ On all supported OS/Platforms, the following PHP versions can be set up as per the runner.
107
107
 
108
- - PHP 5.3 to PHP 8.5 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
109
- - PHP 5.6 to PHP 8.5 on GitHub-hosted macOS ARM64 runners (macos-14).
110
- - PHP 5.6 to PHP 8.5 on self-hosted runners.
108
+ - PHP 5.3 to PHP 8.6 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
109
+ - PHP 5.6 to PHP 8.6 on GitHub-hosted macOS ARM64 runners (macos-14).
110
+ - PHP 5.6 to PHP 8.6 on self-hosted runners.
111
111
 
112
112
  | PHP Version | Stability | Release Support | Runner Support |
113
113
  |-------------|-----------|-----------------------|--------------------------------|
@@ -121,15 +121,16 @@ On all supported OS/Platforms the following PHP versions can be set up as per th
121
121
  | `7.3` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
122
122
  | `7.4` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
123
123
  | `8.0` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
124
- | `8.1` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
124
+ | `8.1` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
125
125
  | `8.2` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
126
- | `8.3` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
126
+ | `8.3` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
127
127
  | `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
128
- | `8.5` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
128
+ | `8.5` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
129
+ | `8.6` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
129
130
 
130
131
 
131
132
  > [!Note]
132
- > - Specifying `8.5` in `php-version` input installs a nightly build of `PHP 8.5.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
133
+ > - Specifying `8.6` in `php-version` input installs a nightly build of `PHP 8.6.0-dev` from the master branch of PHP. See [nightly build setup](#nightly-build-setup) for more information.
133
134
  > - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
134
135
 
135
136
  ## :heavy_plus_sign: PHP Extension Support
@@ -142,8 +143,8 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
142
143
  - name: Setup PHP with PECL extension
143
144
  uses: shivammathur/setup-php@v2
144
145
  with:
145
- php-version: '8.4'
146
- extensions: imagick, swoole
146
+ php-version: '8.5'
147
+ extensions: imagick, redis
147
148
  ```
148
149
 
149
150
  - On `Windows`, extensions available on `PECL` which have the `DLL` binary can be set up.
@@ -170,7 +171,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
170
171
  - name: Setup PHP with pre-release PECL extension
171
172
  uses: shivammathur/setup-php@v2
172
173
  with:
173
- php-version: '8.4'
174
+ php-version: '8.5'
174
175
  extensions: xdebug-beta
175
176
  ```
176
177
 
@@ -182,30 +183,30 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
182
183
  - name: Setup PHP and disable opcache
183
184
  uses: shivammathur/setup-php@v2
184
185
  with:
185
- php-version: '8.4'
186
- extensions: :opcache
186
+ php-version: '8.5'
187
+ extensions: :mbstring
187
188
  ```
188
189
 
189
190
  - All shared extensions can be disabled by specifying `none`. When `none` is specified along with other extensions, it is hoisted to the start of the input. So, all the shared extensions will be disabled first, then rest of the extensions in the input will be processed.
190
191
 
191
- This disables all core and third-party shared extensions and thus, can break some tools which need them. Required extensions are enabled again when the tools are set up on a best-effort basis. So it is recommended to add the extensions required for your tools after `none` in the `extensions` input to avoid any issues.
192
+ This disables all core and third-party shared extensions and thus, can break some tools that need them. Required extensions are enabled again when the tools are set up on a best-effort basis. So it is recommended to add the extensions required for your tools after `none` in the `extensions` input to avoid any issues.
192
193
 
193
194
  ```yaml
194
195
  - name: Setup PHP without any shared extensions except mbstring
195
196
  uses: shivammathur/setup-php@v2
196
197
  with:
197
- php-version: '8.4'
198
+ php-version: '8.5'
198
199
  extensions: none, mbstring
199
200
  ```
200
201
 
201
- - Extension `intl` can be set up with specific `ICU` version for `PHP 5.6` and above in `Ubuntu` workflows by suffixing `intl` with the `ICU` version. `ICU 50.2` and newer versions are supported. Refer to [`ICU builds`](https://github.com/shivammathur/icu-intl#icu4c-builds) for the specific versions supported.
202
+ - Extension `intl` can be set up with specific `ICU` version for `PHP 5.6` and above in `Ubuntu` workflows by suffixing `intl` with the `ICU` version. `ICU 50.2` and newer versions are supported for PHP 8.4 and lower, `ICU 57.2` and newer versions are supported for PHP 8.5 and above. Refer to [`ICU builds`](https://github.com/shivammathur/icu-intl#icu4c-builds) for the specific versions supported.
202
203
 
203
204
  ```yaml
204
205
  - name: Setup PHP with intl
205
206
  uses: shivammathur/setup-php@v2
206
207
  with:
207
- php-version: '8.4'
208
- extensions: intl-70.1
208
+ php-version: '8.5'
209
+ extensions: intl-77.1
209
210
  ```
210
211
 
211
212
  - Extensions loaded by default after `setup-php` runs can be found on the [wiki](https://github.com/shivammathur/setup-php/wiki).
@@ -213,7 +214,7 @@ This disables all core and third-party shared extensions and thus, can break som
213
214
  - These extensions have custom support:
214
215
  - `cubrid` and `pdo_cubrid` on `Ubuntu`.
215
216
  - `event`, `gearman`, `geos` and `relay` on `Ubuntu` and `macOS`.
216
- - `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4`, `phalcon5`, and `zephir_parser` on all supported OS.
217
+ - `blackfire`, `couchbase`, `ibm_db2`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_ibm`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4`, `phalcon5`, and `zephir_parser` on all supported OS.
217
218
 
218
219
  - By default, extensions which cannot be added or disabled gracefully leave an error message in the logs, the execution is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
219
220
 
@@ -221,7 +222,7 @@ This disables all core and third-party shared extensions and thus, can break som
221
222
  - name: Setup PHP with fail-fast
222
223
  uses: shivammathur/setup-php@v2
223
224
  with:
224
- php-version: '8.4'
225
+ php-version: '8.5'
225
226
  extensions: oci8
226
227
  env:
227
228
  fail-fast: true
@@ -237,7 +238,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
237
238
  - name: Setup PHP with tools
238
239
  uses: shivammathur/setup-php@v2
239
240
  with:
240
- php-version: '8.4'
241
+ php-version: '8.5'
241
242
  tools: php-cs-fixer, phpunit
242
243
  ```
243
244
 
@@ -247,7 +248,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
247
248
  - name: Setup PHP with tools
248
249
  uses: shivammathur/setup-php@v2
249
250
  with:
250
- php-version: '8.4'
251
+ php-version: '8.5'
251
252
  tools: vimeo/psalm
252
253
  ```
253
254
 
@@ -266,7 +267,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
266
267
  - name: Setup PHP with composer v2
267
268
  uses: shivammathur/setup-php@v2
268
269
  with:
269
- php-version: '8.4'
270
+ php-version: '8.5'
270
271
  tools: composer:v1
271
272
  ```
272
273
 
@@ -276,7 +277,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
276
277
  - name: Setup PHP without composer
277
278
  uses: shivammathur/setup-php@v2
278
279
  with:
279
- php-version: '8.4'
280
+ php-version: '8.5'
280
281
  tools: none
281
282
  ```
282
283
 
@@ -292,7 +293,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
292
293
  - name: Setup PHP with fail-fast
293
294
  uses: shivammathur/setup-php@v2
294
295
  with:
295
- php-version: '8.4'
296
+ php-version: '8.5'
296
297
  tools: deployer
297
298
  env:
298
299
  fail-fast: true
@@ -304,7 +305,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
304
305
  - name: Setup PHP with fail-fast
305
306
  uses: shivammathur/setup-php@v2
306
307
  with:
307
- php-version: '8.4'
308
+ php-version: '8.5'
308
309
  env:
309
310
  COMPOSER_ALLOW_PLUGINS: composer/installers, composer/satis
310
311
  ```
@@ -320,7 +321,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
320
321
  - name: Setup PHP with composer and custom process timeout
321
322
  uses: shivammathur/setup-php@v2
322
323
  with:
323
- php-version: '8.4'
324
+ php-version: '8.5'
324
325
  env:
325
326
  COMPOSER_PROCESS_TIMEOUT: 300
326
327
  ```
@@ -336,7 +337,7 @@ Runs on all [PHP versions supported](#tada-php-support "List of PHP versions sup
336
337
  - name: Setup PHP with Xdebug
337
338
  uses: shivammathur/setup-php@v2
338
339
  with:
339
- php-version: '8.4'
340
+ php-version: '8.5'
340
341
  coverage: xdebug
341
342
  ```
342
343
 
@@ -365,12 +366,12 @@ Runs on PHP 7.1 and newer PHP versions.
365
366
  - name: Setup PHP with PCOV
366
367
  uses: shivammathur/setup-php@v2
367
368
  with:
368
- php-version: '8.4'
369
+ php-version: '8.5'
369
370
  ini-values: pcov.directory=api #optional, see above for usage.
370
371
  coverage: pcov
371
372
  ```
372
373
 
373
- - PHPUnit 8.x and above supports PCOV out of the box.
374
+ - PHPUnit 8.x and above support PCOV out of the box.
374
375
  - If you are using PHPUnit 5.x, 6.x or 7.x, you need to set up `pcov/clobber` before executing your tests.
375
376
 
376
377
  ```yaml
@@ -395,7 +396,7 @@ Disable coverage for these reasons:
395
396
  - name: Setup PHP with no coverage driver
396
397
  uses: shivammathur/setup-php@v2
397
398
  with:
398
- php-version: '8.4'
399
+ php-version: '8.5'
399
400
  coverage: none
400
401
  ```
401
402
 
@@ -408,7 +409,7 @@ Disable coverage for these reasons:
408
409
  #### `php-version` (optional)
409
410
 
410
411
  - Specify the PHP version you want to set up.
411
- - Accepts a `string`. For example `'8.4'`.
412
+ - Accepts a `string`. For example `'8.5'`.
412
413
  - Accepts `lowest` to set up the lowest supported PHP version.
413
414
  - Accepts `highest` or `latest` to set up the latest stable PHP version.
414
415
  - Accepts `nightly` to set up a nightly build from the master branch of PHP.
@@ -482,7 +483,7 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
482
483
  id: setup-php
483
484
  uses: shivammathur/setup-php@v2
484
485
  with:
485
- php-version: '8.4'
486
+ php-version: '8.5'
486
487
 
487
488
  - name: Print PHP version
488
489
  run: echo ${{ steps.setup-php.outputs.php-version }}
@@ -524,7 +525,7 @@ steps:
524
525
  - name: Setup PHP
525
526
  uses: shivammathur/setup-php@v2
526
527
  with:
527
- php-version: '8.4'
528
+ php-version: '8.5'
528
529
  extensions: mbstring, intl
529
530
  ini-values: post_max_size=256M, max_execution_time=180
530
531
  coverage: xdebug
@@ -542,7 +543,7 @@ jobs:
542
543
  strategy:
543
544
  matrix:
544
545
  operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
545
- php-versions: ['8.2', '8.3', '8.4']
546
+ php-versions: ['8.2', '8.3', '8.4', '8.5']
546
547
  phpunit-versions: ['latest']
547
548
  include:
548
549
  - operating-system: 'ubuntu-latest'
@@ -561,17 +562,17 @@ jobs:
561
562
 
562
563
  ### Nightly Build Setup
563
564
 
564
- > Set up a nightly build of `PHP 8.5`.
565
+ > Set up a nightly build of `PHP 8.6`.
565
566
 
566
567
  - These PHP versions are currently in active development and might contain bugs and breaking changes.
567
- - Some user space extensions might not support this version currently.
568
+ - Some user space extensions might not support these versions currently.
568
569
 
569
570
  ```yaml
570
571
  steps:
571
572
  - name: Setup nightly PHP
572
573
  uses: shivammathur/setup-php@v2
573
574
  with:
574
- php-version: '8.5'
575
+ php-version: '8.6'
575
576
  extensions: mbstring
576
577
  ini-values: post_max_size=256M, max_execution_time=180
577
578
  coverage: xdebug
@@ -595,7 +596,7 @@ steps:
595
596
  - name: Setup PHP with debugging symbols
596
597
  uses: shivammathur/setup-php@v2
597
598
  with:
598
- php-version: '8.4'
599
+ php-version: '8.5'
599
600
  env:
600
601
  debug: true # specify true or false
601
602
  ```
@@ -615,7 +616,7 @@ jobs:
615
616
  - name: Setup PHP
616
617
  uses: shivammathur/setup-php@v2
617
618
  with:
618
- php-version: '8.4'
619
+ php-version: '8.5'
619
620
  env:
620
621
  phpts: ts # specify ts or nts
621
622
  ```
@@ -632,7 +633,7 @@ jobs:
632
633
  - name: Setup PHP with latest versions
633
634
  uses: shivammathur/setup-php@v2
634
635
  with:
635
- php-version: '8.4'
636
+ php-version: '8.5'
636
637
  env:
637
638
  update: true # specify true or false
638
639
  ```
@@ -647,30 +648,35 @@ To debug any issues, you can use the `verbose` tag instead of `v2`.
647
648
  - name: Setup PHP with logs
648
649
  uses: shivammathur/setup-php@verbose
649
650
  with:
650
- php-version: '8.4'
651
+ php-version: '8.5'
651
652
  ```
652
653
 
653
654
  ### Multi-Arch Setup
654
655
 
655
656
  > Set up PHP on multiple architecture on Ubuntu GitHub Runners.
656
657
 
657
- - `PHP 5.6` to `PHP 8.4` are supported by `setup-php` on multiple architecture on `Ubuntu`.
658
- - For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` installed for `setup-php`.
659
- - Currently, for `ARM` based setup, you will need [self-hosted runners](#self-hosted-setup).
658
+ - `PHP 5.6` to `PHP 8.5` are supported by `setup-php` on multiple architecture on `Ubuntu` and `Debian`.
659
+ - For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `PHP` installed for `setup-php`.
660
660
 
661
661
  ```yaml
662
662
  jobs:
663
663
  run:
664
- runs-on: ubuntu-latest
665
- container: shivammathur/node:latest-${{ matrix.arch }}
664
+ runs-on: ${{ matrix.os }}
665
+ container: shivammathur/node:php-${{ matrix.php-versions }}-24.04-${{ matrix.arch }}
666
666
  strategy:
667
667
  matrix:
668
- arch: ["amd64", "i386"]
668
+ arch: ["amd64", "arm64v8"]
669
+ php-versions: [8.4, 8.5]
670
+ include:
671
+ - arch: "amd64"
672
+ os: "ubuntu-24.04"
673
+ - arch: "arm64v8"
674
+ os: "ubuntu-24.04-arm"
669
675
  steps:
670
676
  - name: Install PHP
671
677
  uses: shivammathur/setup-php@v2
672
678
  with:
673
- php-version: '8.4'
679
+ php-version: ${{ matrix.php-versions }}
674
680
  ```
675
681
 
676
682
  ### Self Hosted Setup
@@ -692,7 +698,7 @@ jobs:
692
698
  runs-on: self-hosted
693
699
  strategy:
694
700
  matrix:
695
- php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
701
+ php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
696
702
  name: PHP ${{ matrix.php-versions }}
697
703
  steps:
698
704
  - name: Setup PHP
@@ -705,7 +711,7 @@ jobs:
705
711
 
706
712
  > [!NOTE]
707
713
  > - Do not set up multiple self-hosted runners on a single server instance as parallel workflow will conflict with each other.
708
- > - Do not set up self-hosted runners on the side on your development environment or your production server.
714
+ > - Do not set up self-hosted runners on the side of your development environment or your production server.
709
715
  > - Avoid using the same labels for your `self-hosted` runners which are used by `GitHub-hosted` runners.
710
716
 
711
717
  ### Local Testing Setup
@@ -720,22 +726,22 @@ jobs:
720
726
  - name: Setup PHP
721
727
  uses: shivammathur/setup-php@v2
722
728
  with:
723
- php-version: '8.4'
729
+ php-version: '8.5'
724
730
  ```
725
731
 
726
732
  Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
727
733
 
728
- Choose the image tag which matches the `runs-on` property in your workflow. For example, if you are using `ubuntu-22.04` in your workflow, run `act -P ubuntu-22.04=shivammathur/node:2204`.
734
+ Choose the image tag which matches the `runs-on` property in your workflow. For example, if you are using `ubuntu-22.04` in your workflow, run `act -P ubuntu-22.04=shivammathur/node:22.04`.
729
735
 
730
736
  ```bash
731
737
  # For runs-on: ubuntu-latest
732
738
  act -P ubuntu-latest=shivammathur/node:latest
733
739
 
734
740
  # For runs-on: ubuntu-24.04
735
- act -P ubuntu-24.04=shivammathur/node:2404
741
+ act -P ubuntu-24.04=shivammathur/node:24.04
736
742
 
737
743
  # For runs-on: ubuntu-22.04
738
- act -P ubuntu-22.04=shivammathur/node:2204
744
+ act -P ubuntu-22.04=shivammathur/node:22.04
739
745
  ```
740
746
 
741
747
  ### JIT Configuration
@@ -753,7 +759,7 @@ For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
753
759
  - name: Setup PHP with JIT in tracing mode
754
760
  uses: shivammathur/setup-php@v2
755
761
  with:
756
- php-version: '8.4'
762
+ php-version: '8.5'
757
763
  coverage: none
758
764
  ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M
759
765
  ```
@@ -804,7 +810,7 @@ By default, setup-php uses the `GITHUB_TOKEN` secret that is generated for each
804
810
  - name: Setup PHP
805
811
  uses: shivammathur/setup-php@v2
806
812
  with:
807
- php-version: '8.4'
813
+ php-version: '8.5'
808
814
  github-token: ${{ secrets.YOUR_PAT_TOKEN }}
809
815
  ```
810
816
 
@@ -820,7 +826,7 @@ If you use Private Packagist for your private composer dependencies, you can set
820
826
  - name: Setup PHP
821
827
  uses: shivammathur/setup-php@v2
822
828
  with:
823
- php-version: '8.4'
829
+ php-version: '8.5'
824
830
  env:
825
831
  PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
826
832
  ```
@@ -834,7 +840,7 @@ Please refer to the authentication section in [`composer documentation`](https:/
834
840
  - name: Setup PHP
835
841
  uses: shivammathur/setup-php@v2
836
842
  with:
837
- php-version: '8.4'
843
+ php-version: '8.5'
838
844
  env:
839
845
  COMPOSER_AUTH_JSON: |
840
846
  {
@@ -857,7 +863,7 @@ Put the code in the run property of a step and specify the shell as `php {0}`.
857
863
  - name: Setup PHP
858
864
  uses: shivammathur/setup-php@v2
859
865
  with:
860
- php-version: '8.4'
866
+ php-version: '8.5'
861
867
 
862
868
  - name: Run PHP code
863
869
  shell: php {0}
@@ -897,7 +903,7 @@ PHPStan supports error reporting in GitHub Actions, so it does not require probl
897
903
  - name: Setup PHP
898
904
  uses: shivammathur/setup-php@v2
899
905
  with:
900
- php-version: '8.4'
906
+ php-version: '8.5'
901
907
  tools: phpstan
902
908
 
903
909
  - name: Run PHPStan
@@ -912,7 +918,7 @@ Psalm supports error reporting in GitHub Actions with an output format `github`.
912
918
  - name: Setup PHP
913
919
  uses: shivammathur/setup-php@v2
914
920
  with:
915
- php-version: '8.4'
921
+ php-version: '8.5'
916
922
  tools: psalm
917
923
 
918
924
  - name: Run Psalm
@@ -930,7 +936,7 @@ For examples refer to the [cs2pr documentation](https://github.com/staabm/annota
930
936
  - name: Setup PHP
931
937
  uses: shivammathur/setup-php@v2
932
938
  with:
933
- php-version: '8.4'
939
+ php-version: '8.5'
934
940
  tools: cs2pr, phpcs
935
941
 
936
942
  - name: Run phpcs
@@ -1000,18 +1006,14 @@ Examples of using `setup-php` with various PHP frameworks and packages.
1000
1006
 
1001
1007
  ## :sparkling_heart: Support This Project
1002
1008
 
1003
- - Please star the project and share it. If you blog, please share your experience of using `setup-php`.
1004
- - Please [reach out](mailto:contact@setup-php.com) if you have any questions about sponsoring setup-php.
1005
-
1006
- Many users and organisations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
1007
-
1008
- <a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
1009
-
1010
1009
  These companies generously provide setup-php their products and services to aid in the development of this project.
1011
1010
 
1012
1011
  <p>
1013
- <a target="_blank" href="https://www.jetbrains.com/?from=setup-php">
1014
- <img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="80">
1012
+ <a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only">
1013
+ <img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="100">
1014
+ </a>
1015
+ <a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only">
1016
+ <img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140" height="100">
1015
1017
  </a>
1016
1018
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1017
1019
  <a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only">
@@ -1028,11 +1030,22 @@ These companies generously provide setup-php their products and services to aid
1028
1030
  <img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80">
1029
1031
  </a>
1030
1032
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1031
- <a target="_blank" href="#">
1032
- <img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="94" height="80">
1033
+ <a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-light-mode-only">
1034
+ <img src="https://setup-php.com/sponsors/digitalocean.svg" alt="Digitalocean" width="100" height="100">
1035
+ </a>
1036
+ <a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-dark-mode-only">
1037
+ <img src="https://setup-php.com/sponsors/digitalocean-white.svg" alt="Digitalocean" width="100" height="100">
1033
1038
  </a>
1034
1039
  </p>
1035
1040
 
1041
+ Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
1042
+
1043
+ <a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
1044
+
1045
+ - If you use setup-php, please consider starring the project and share it.
1046
+ - If you blog, please share your experience of using `setup-php`.
1047
+ - Please [reach out](mailto:contact@setup-php.com) if you have any questions about sponsoring setup-php.
1048
+
1036
1049
  ## :package: Dependencies
1037
1050
 
1038
1051
  - [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
@@ -1075,7 +1088,7 @@ These companies generously provide setup-php their products and services to aid
1075
1088
  [`cs2pr`]: https://github.com/staabm/annotate-pull-request-from-checkstyle
1076
1089
  [`deployer`]: https://deployer.org/
1077
1090
  [`ecs`]: https://github.com/easy-coding-standard/easy-coding-standard
1078
- [`flex`]: https://flex.symfony.com/
1091
+ [`flex`]: https://github.com/symfony/flex
1079
1092
  [`grpc_php_plugin`]: https://grpc.io/
1080
1093
  [`infection`]: https://infection.github.io/
1081
1094
  [`mago`]: https://github.com/carthage-software/mago
package/lib/core.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ interface CommandProperties {
2
+ [key: string]: string;
3
+ }
4
+ export declare function issueCommand(command: string, properties: CommandProperties, message: string | Error): void;
5
+ export declare function error(message: string | Error): void;
6
+ export declare function setFailed(message: string | Error): void;
7
+ export declare function getInput(name: string, required?: boolean): string;
8
+ export {};
package/lib/core.js ADDED
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.issueCommand = issueCommand;
4
+ exports.error = error;
5
+ exports.setFailed = setFailed;
6
+ exports.getInput = getInput;
7
+ const os_1 = require("os");
8
+ function toCommandValue(message) {
9
+ if (message instanceof Error) {
10
+ return message.toString();
11
+ }
12
+ return message;
13
+ }
14
+ function escapeData(s) {
15
+ return toCommandValue(s)
16
+ .replace(/%/g, '%25')
17
+ .replace(/\r/g, '%0D')
18
+ .replace(/\n/g, '%0A');
19
+ }
20
+ function escapeProperty(s) {
21
+ return s
22
+ .replace(/%/g, '%25')
23
+ .replace(/\r/g, '%0D')
24
+ .replace(/\n/g, '%0A')
25
+ .replace(/:/g, '%3A')
26
+ .replace(/,/g, '%2C');
27
+ }
28
+ function issueCommand(command, properties, message) {
29
+ let cmdStr = `::${command}`;
30
+ if (properties && Object.keys(properties).length > 0) {
31
+ cmdStr += ' ';
32
+ const props = Object.entries(properties)
33
+ .filter(([, val]) => val)
34
+ .map(([key, val]) => `${key}=${escapeProperty(val)}`)
35
+ .join(',');
36
+ cmdStr += props;
37
+ }
38
+ cmdStr += `::${escapeData(message)}`;
39
+ process.stdout.write(cmdStr + os_1.EOL);
40
+ }
41
+ function error(message) {
42
+ issueCommand('error', {}, message);
43
+ }
44
+ function setFailed(message) {
45
+ process.exitCode = 1;
46
+ error(message);
47
+ }
48
+ function getInput(name, required = false) {
49
+ const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
50
+ if (required && !val) {
51
+ throw new Error(`Input required and not supplied: ${name}`);
52
+ }
53
+ return val.trim();
54
+ }
55
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;AAyDA,oCAkBC;AAMD,sBAEC;AAOD,8BAGC;AAWD,4BAOC;AA/GD,2BAAuB;AAmBvB,SAAS,cAAc,CAAC,OAAuB;IAC7C,IAAI,OAAO,YAAY,KAAK,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAMD,SAAS,UAAU,CAAC,CAAiB;IACnC,OAAO,cAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC3B,CAAC;AAMD,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC;SACL,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1B,CAAC;AASD,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAuB;IAEvB,IAAI,MAAM,GAAG,KAAK,OAAO,EAAE,CAAC;IAE5B,IAAI,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,CAAC;QACd,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;aACrC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC;aACxB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;aACpD,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,MAAM,IAAI,KAAK,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,KAAK,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,QAAG,CAAC,CAAC;AACrC,CAAC;AAMD,SAAgB,KAAK,CAAC,OAAuB;IAC3C,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC;AAOD,SAAgB,SAAS,CAAC,OAAuB;IAC/C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACrB,KAAK,CAAC,OAAO,CAAC,CAAC;AACjB,CAAC;AAWD,SAAgB,QAAQ,CAAC,IAAY,EAAE,QAAQ,GAAG,KAAK;IACrD,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IACtE,IAAI,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC"}