setup-php 2.26.0 → 2.27.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.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  <p align="center">
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
- <a href="https://github.com/shivammathur/setup-php/blob/master/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>
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
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.4-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
14
14
  </p>
15
15
  <p align="center">
@@ -77,8 +77,8 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
77
77
  | Ubuntu 20.04 | `ubuntu-20.04` | `PHP 7.4` to `PHP 8.2` |
78
78
  | Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.2` |
79
79
  | Windows Server 2019 | `windows-2019` | `PHP 8.2` |
80
- | macOS Monterey 12.x | `macos-12` | `PHP 8.2` |
81
- | macOS Big Sur 11.x | `macos-latest` or `macos-11` | `PHP 8.2` |
80
+ | macOS Ventura 13.x | `macos-13` | `PHP 8.2` |
81
+ | macOS Monterey 12.x | `macos-latest` or `macos-12` | `PHP 8.2` |
82
82
 
83
83
  ### Self-Hosted Runners
84
84
 
@@ -90,9 +90,9 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
90
90
  | Debian 10 | `self-hosted` or `Linux` |
91
91
  | Windows 7 and newer | `self-hosted` or `Windows` |
92
92
  | Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
93
+ | macOS Sonoma 14.x x86_64/arm64 | `self-hosted` or `macOS` |
93
94
  | macOS Ventura 13.x x86_64/arm64 | `self-hosted` or `macOS` |
94
95
  | macOS Monterey 12.x x86_64/arm64 | `self-hosted` or `macOS` |
95
- | macOS Big Sur 11.x x86_64/arm64 | `self-hosted` or `macOS` |
96
96
 
97
97
  - Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
98
98
  - Operating systems based on the above Ubuntu and Debian versions are also supported on best effort basis.
@@ -940,9 +940,10 @@ Examples of using `setup-php` with various PHP frameworks and packages.
940
940
 
941
941
  - Use the `v2` tag as `setup-php` version. It is a rolling tag and is synced with the latest minor and patch releases. With `v2` you automatically get the bug fixes, security patches, new features and support for latest PHP releases.
942
942
  - Semantic release versions can also be used. It is recommended to [use dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot "Setup Dependabot with GitHub Actions") with semantic versioning to keep the actions in your workflows up to date.
943
- - Commit SHA can also be used, but are not recommended. They have to be updated with every release manually, without which you will not get any bug fixes, security patches or new features.
943
+ - Commit SHA can also be used, but are not recommended unless you set up tooling to update them with each release of the action.
944
+ - A new major version of the action will only be tagged when there are breaking changes in the setup-php API i.e. inputs, outputs, and environment flags.
944
945
  - For debugging any issues `verbose` tag can be used temporarily. It outputs all the logs and is also synced with the latest releases.
945
- - It is highly discouraged to use the `master` branch as version, it might break your workflow after major releases as they have breaking changes.
946
+ - It is highly discouraged to use the `main` branch as version, it might break your workflow after major releases as they have breaking changes.
946
947
  - If you are using the `v1` tag or a `1.x.y` version, you should [switch to v2](https://github.com/shivammathur/setup-php/wiki/Switch-to-v2 "Guide for switching from setup-php v1 to v2") as `v1` only gets critical bug fixes. Maintenance support for `v1` will be dropped with the last `PHP 8.0` release.
947
948
 
948
949
  ## :scroll: License
package/lib/fetch.js CHANGED
@@ -38,7 +38,8 @@ async function fetch(input_url, auth_token, redirect_count = 5) {
38
38
  const options = {
39
39
  hostname: url_object.hostname,
40
40
  path: url_object.pathname,
41
- headers: headers
41
+ headers: headers,
42
+ agent: new https.Agent({ keepAlive: false })
42
43
  };
43
44
  const req = https.get(options, (res) => {
44
45
  if (res.statusCode === 200) {
package/lib/fetch.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA+B;AAC/B,yCAA2B;AASpB,KAAK,UAAU,KAAK,CACzB,SAAiB,EACjB,UAAmB,EACnB,cAAc,GAAG,CAAC;IAElB,MAAM,aAAa,GAAoC,IAAI,OAAO,CAChE,OAAO,CAAC,EAAE;QACR,MAAM,UAAU,GAAkB,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,OAAO,GAAwB;YACnC,YAAY,EAAE,gBAAgB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,aAAa;SAC5E,CAAC;QACF,IAAI,UAAU,EAAE;YACd,OAAO,CAAC,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;SAChD;QACD,MAAM,OAAO,GAAyB;YACpC,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,IAAI,EAAE,UAAU,CAAC,QAAQ;YACzB,OAAO,EAAE,OAAO;SACjB,CAAC;QACF,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,GAAoB,EAAE,EAAE;YACtD,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE;gBAC1B,IAAI,IAAI,GAAG,EAAE,CAAC;gBACd,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC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CAAC,IAAI,CAC5D,OAAO,CACR,CAAC;iBACH;qBAAM;oBACL,OAAO,CAAC,EAAC,KAAK,EAAE,GAAG,GAAG,CAAC,UAAU,kBAAkB,EAAC,CAAC,CAAC;iBACvD;aACF;iBAAM;gBACL,OAAO,CAAC,EAAC,KAAK,EAAE,GAAG,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,aAAa,EAAE,EAAC,CAAC,CAAC;aAC7D;QACH,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,GAAG,EAAE,CAAC;IACZ,CAAC,CACF,CAAC;IACF,OAAO,MAAM,aAAa,CAAC;AAC7B,CAAC;AA5CD,sBA4CC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "setup-php",
3
- "version": "2.26.0",
3
+ "version": "2.27.0",
4
4
  "private": false,
5
5
  "description": "Setup PHP for use with GitHub Actions",
6
6
  "main": "lib/install.js",
@@ -34,25 +34,25 @@
34
34
  "author": "shivammathur",
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@actions/core": "^1.10.0",
37
+ "@actions/core": "^1.10.1",
38
38
  "@actions/exec": "^1.1.1",
39
39
  "@actions/io": "^1.1.3",
40
40
  "compare-versions": "^6.1.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/jest": "^29.5.4",
44
- "@types/node": "^20.6.0",
45
- "@typescript-eslint/eslint-plugin": "^6.6.0",
46
- "@typescript-eslint/parser": "^6.6.0",
47
- "@vercel/ncc": "^0.38.0",
48
- "eslint": "^8.49.0",
43
+ "@types/jest": "^29.5.7",
44
+ "@types/node": "^20.8.10",
45
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
46
+ "@typescript-eslint/parser": "^6.9.1",
47
+ "@vercel/ncc": "^0.38.1",
48
+ "eslint": "^8.52.0",
49
49
  "eslint-config-prettier": "^9.0.0",
50
- "eslint-plugin-import": "^2.28.1",
51
- "eslint-plugin-jest": "^27.2.3",
52
- "eslint-plugin-prettier": "^5.0.0",
53
- "jest": "^29.6.4",
54
- "jest-circus": "^29.6.4",
55
- "nock": "^13.3.3",
50
+ "eslint-plugin-import": "^2.29.0",
51
+ "eslint-plugin-jest": "^27.6.0",
52
+ "eslint-plugin-prettier": "^5.0.1",
53
+ "jest": "^29.7.0",
54
+ "jest-circus": "^29.7.0",
55
+ "nock": "^13.3.7",
56
56
  "prettier": "^3.0.3",
57
57
  "simple-git-hooks": "^2.9.0",
58
58
  "ts-jest": "^29.1.1",
@@ -1,4 +1,13 @@
1
1
  {
2
+ "box": {
3
+ "type": "phar",
4
+ "repository": "box-project/box",
5
+ "packagist": "humbug/box",
6
+ "extension": ".phar",
7
+ "domain": "https://github.com",
8
+ "version_prefix": "",
9
+ "version_parameter": "--version"
10
+ },
2
11
  "churn": {
3
12
  "type": "phar",
4
13
  "repository": "bmitch/churn-php",
@@ -64,6 +73,15 @@
64
73
  "version_prefix": "v",
65
74
  "version_parameter": "-V"
66
75
  },
76
+ "php-scoper": {
77
+ "type": "phar",
78
+ "repository": "humbug/php-scoper",
79
+ "packagist": "humbug/php-scoper",
80
+ "extension": ".phar",
81
+ "domain": "https://github.com",
82
+ "version_prefix": "",
83
+ "version_parameter": "--version"
84
+ },
67
85
  "phpcbf": {
68
86
  "type": "phar",
69
87
  "repository": "squizlabs/PHP_CodeSniffer",
package/src/fetch.ts CHANGED
@@ -26,7 +26,8 @@ export async function fetch(
26
26
  const options: https.RequestOptions = {
27
27
  hostname: url_object.hostname,
28
28
  path: url_object.pathname,
29
- headers: headers
29
+ headers: headers,
30
+ agent: new https.Agent({keepAlive: false})
30
31
  };
31
32
  const req = https.get(options, (res: IncomingMessage) => {
32
33
  if (res.statusCode === 200) {
@@ -43,7 +43,9 @@ copy_brew_extensions() {
43
43
  extension_file="${brew_prefix:?}/opt/$dependency/$(get_extension_from_formula "${dependency%@*}").so"
44
44
  [ -e "$extension_file" ] && sudo cp "$extension_file" "$ext_dir"
45
45
  done
46
- sudo find -- "$brew_prefix"/Cellar/"$formula"@"$version" -name "*.dylib" -exec cp {} "$ext_dir" \;
46
+ if [ -d "$brew_prefix"/Cellar/"$formula"@"$version" ]; then
47
+ sudo find -- "$brew_prefix"/Cellar/"$formula"@"$version" -name "*.dylib" -exec cp {} "$ext_dir" \;
48
+ fi
47
49
  }
48
50
 
49
51
  # Function to install a php extension from shivammathur/extensions tap.
@@ -60,8 +62,7 @@ add_brew_extension() {
60
62
  sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "${core_repo:?}/Formula/" 2>/dev/null || true
61
63
  update_dependencies >/dev/null 2>&1
62
64
  disable_dependency_extensions "$extension" >/dev/null 2>&1
63
- brew install -f "$ext_tap/$formula@$version" >/dev/null 2>&1
64
- copy_brew_extensions "$formula"
65
+ (brew install -f "$ext_tap/$formula@$version" >/dev/null 2>&1 && copy_brew_extensions "$formula") || pecl_install "$extension" >/dev/null 2>&1
65
66
  add_extension_log "$extension" "Installed and enabled"
66
67
  fi
67
68
  }
@@ -162,8 +163,11 @@ fix_dependencies() {
162
163
 
163
164
  # Function to get PHP version if it is already installed using Homebrew.
164
165
  get_brewed_php() {
165
- php_cellar="$brew_prefix"/Cellar/php
166
- if [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
166
+ cellar="$brew_prefix"/Cellar
167
+ php_cellar="$cellar"/php
168
+ if [ -d "$cellar" ] && ! [[ "$(find "$cellar" -maxdepth 1 -name "php@$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
169
+ php_semver | cut -c 1-3
170
+ elif [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
167
171
  php_semver | cut -c 1-3
168
172
  else
169
173
  echo 'false';
@@ -32,6 +32,8 @@ get_couchbase_version() {
32
32
  echo couchbase-3.0.4
33
33
  elif [ "${version:?}" = '7.3' ]; then
34
34
  echo couchbase-3.2.2
35
+ elif [ "${version:?}" = '7.4' ]; then
36
+ echo couchbase-4.1.0
35
37
  else
36
38
  echo couchbase
37
39
  fi
@@ -55,6 +57,9 @@ add_couchbase() {
55
57
  else
56
58
  if [ "$ext" = "couchbase" ]; then
57
59
  ext="couchbase-$(get_pecl_version "couchbase" "stable")"
60
+ n_proc="$(nproc)"
61
+ export COUCHBASE_SUFFIX_OPTS="CMAKE_BUILD_TYPE=Release"
62
+ export CMAKE_BUILD_PARALLEL_LEVEL="$n_proc"
58
63
  add_extension_from_source couchbase https://pecl.php.net couchbase couchbase "${ext##*-}" extension pecl >/dev/null 2>&1
59
64
  else
60
65
  pecl_install "${ext}" >/dev/null 2>&1
@@ -85,7 +85,9 @@ Function Add-ToolsHelper() {
85
85
  $tool
86
86
  )
87
87
  $extensions = @();
88
- if($tool -eq "codeception") {
88
+ if($tool -eq "box") {
89
+ $extensions += @('iconv', 'mbstring', 'phar', 'sodium')
90
+ } elseif($tool -eq "codeception") {
89
91
  $extensions += @('json', 'mbstring')
90
92
  Copy-Item $env:codeception_bin\codecept.bat -Destination $env:codeception_bin\codeception.bat
91
93
  } elseif($tool -eq "composer") {
@@ -74,6 +74,8 @@ add_tools_helper() {
74
74
  extensions=()
75
75
  if [ "$tool" = "blackfire-player" ]; then
76
76
  extensions+=(uuid)
77
+ elif [ "$tool" = "box" ]; then
78
+ extensions+=(iconv mbstring phar sodium)
77
79
  elif [ "$tool" = "codeception" ]; then
78
80
  extensions+=(json mbstring)
79
81
  sudo ln -s "$scoped_dir"/vendor/bin/codecept "$scoped_dir"/vendor/bin/codeception
@@ -130,6 +132,9 @@ add_tool() {
130
132
  tool=$2
131
133
  ver_param=$3
132
134
  tool_path="$tool_path_dir/$tool"
135
+ if ! [ -d "$tool_path_dir" ]; then
136
+ sudo mkdir -p "$tool_path_dir"
137
+ fi
133
138
  add_path "$tool_path_dir"
134
139
  if [ -e "$tool_path" ]; then
135
140
  sudo cp -aL "$tool_path" /tmp/"$tool"