mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-02 21:23:17 +07:00
Compare commits
82 Commits
Author | SHA1 | Date | |
---|---|---|---|
9e72090525 | |||
34b79cab10 | |||
e5af5d68b4 | |||
ba21a89e0b | |||
12b88cf3e2 | |||
cffd8ca58a | |||
85ed51cf85 | |||
5bb2eed0aa | |||
96fb539134 | |||
775fa76ea4 | |||
da729085ef | |||
b6d8115f12 | |||
84f76b1fc9 | |||
cdfde5ebec | |||
7e98140142 | |||
85a8dfd0c7 | |||
7ee42db5db | |||
cdbb89961e | |||
19ba822314 | |||
fb9c2a9f77 | |||
e7453ef93f | |||
efd3a13445 | |||
981ce2a75a | |||
d97b3754a8 | |||
edf0223f7d | |||
516490f3d1 | |||
e77cdb393f | |||
944fb41c67 | |||
0830e5d434 | |||
ae95648cfc | |||
a75ffb672b | |||
80075aeba5 | |||
449afbcaec | |||
ce2f681d22 | |||
cb0fc744e6 | |||
58a6e6fb4b | |||
bf9d25532d | |||
4662a3d03c | |||
e4fb5432c7 | |||
7f1cfc01ec | |||
371ee9d086 | |||
51383ecefe | |||
cf36231a82 | |||
9f51892bda | |||
53f82379e8 | |||
24eff50574 | |||
15b611248c | |||
6e5c13cd3c | |||
e07eecf7a4 | |||
57a6e91640 | |||
c541c155ee | |||
afff805ea3 | |||
594bd591ec | |||
2e947f1f69 | |||
2a5212466c | |||
9c28f9ba58 | |||
b9f1db485f | |||
588b5da142 | |||
a0edbac27b | |||
606ac25b84 | |||
ea566b68c0 | |||
4f124b97f7 | |||
8fe6ba1e38 | |||
193510cd90 | |||
b5f04d97d9 | |||
4b56933e00 | |||
fc14643b0a | |||
fdb0d9d1a7 | |||
622cada40f | |||
2a620039e8 | |||
376a964e21 | |||
d6560b1fbb | |||
868f02c3ff | |||
18975ec414 | |||
c49792fb59 | |||
806c3cc058 | |||
c665c7a15b | |||
b30e4bc764 | |||
436881d084 | |||
14d9660823 | |||
efffd0e4f2 | |||
d802457674 |
@ -1,16 +0,0 @@
|
||||
{
|
||||
"env": { "node": true, "jest": true },
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": { "ecmaVersion": 2021, "sourceType": "module" },
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/errors",
|
||||
"plugin:import/warnings",
|
||||
"plugin:import/typescript",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["@typescript-eslint", "jest"]
|
||||
}
|
42
.github/ISSUE_TEMPLATE/bug.md
vendored
42
.github/ISSUE_TEMPLATE/bug.md
vendored
@ -1,42 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Nice, you found a bug!
|
||||
title: ''
|
||||
labels: 'bug'
|
||||
assignees: 'shivammathur'
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
<!-- Please describe the bug concisely. -->
|
||||
|
||||
**Version**
|
||||
- [ ] I have checked releases, and the bug exists in the latest patch version of `v1` or `v2`.
|
||||
- [ ] `v2`
|
||||
- [ ] `v1`
|
||||
|
||||
**Runners**
|
||||
<!-- Please mark the GitHub Action runner your workflow uses. -->
|
||||
- [ ] GitHub Hosted
|
||||
- [ ] Self Hosted
|
||||
|
||||
**Operating systems**
|
||||
<!-- Please mention the operating systems your workflow uses. -->
|
||||
|
||||
**PHP versions**
|
||||
<!-- Please mention the PHP versions your workflow uses. -->
|
||||
|
||||
**To Reproduce**
|
||||
<!-- Please provide the relevant steps of your workflow `.yml` file. -->
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Screenshots/Logs**
|
||||
<!-- If applicable, add screenshots or logs to help explain your problem. -->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here. -->
|
||||
|
||||
**Are you willing to submit a PR?**
|
||||
<!-- We accept pull requests targeting the develop branch. -->
|
94
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
94
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
name: Bug report
|
||||
description: Nice, you found a bug!
|
||||
title: "Bug: "
|
||||
labels: ["bug"]
|
||||
assignees: ["shivammathur"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Please fill out the sections below to help us address your issue."
|
||||
|
||||
- type: textarea
|
||||
id: bug-description
|
||||
attributes:
|
||||
label: "Describe the bug"
|
||||
placeholder: "Please describe the bug concisely."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: version
|
||||
attributes:
|
||||
label: "Version"
|
||||
description: "I have checked releases, and the bug exists in the latest patch version of `v1` or `v2`."
|
||||
options:
|
||||
- label: "v2"
|
||||
- label: "v1"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: runners
|
||||
attributes:
|
||||
label: "Runners"
|
||||
description: "Please choose the GitHub Action runner your workflow uses."
|
||||
options:
|
||||
- "GitHub Hosted"
|
||||
- "Self Hosted"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: operating-systems
|
||||
attributes:
|
||||
label: "Operating systems"
|
||||
placeholder: "e.g., Ubuntu 20.04, Windows Server 2019, etc."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: php-versions
|
||||
attributes:
|
||||
label: "PHP versions"
|
||||
placeholder: "e.g., PHP 7.4, PHP 8.0, etc."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps-to-reproduce
|
||||
attributes:
|
||||
label: "To Reproduce"
|
||||
placeholder: "Please provide the relevant steps of your workflow `.yml` file."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
placeholder: "A clear and concise description of what you expected to happen."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: screenshots-logs
|
||||
attributes:
|
||||
label: "Screenshots/Logs"
|
||||
placeholder: "Drag and drop images or paste logs here..."
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: "Additional context"
|
||||
placeholder: "Add any other context about the problem here."
|
||||
|
||||
- type: dropdown
|
||||
id: willing-to-submit-pr
|
||||
attributes:
|
||||
label: "Are you willing to submit a PR?"
|
||||
description: "We accept pull requests targeting the develop branch."
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
26
.github/ISSUE_TEMPLATE/feature.md
vendored
26
.github/ISSUE_TEMPLATE/feature.md
vendored
@ -1,26 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature
|
||||
title: ''
|
||||
labels: 'enhancement'
|
||||
assignees: 'shivammathur'
|
||||
|
||||
---
|
||||
|
||||
**Describe the feature**
|
||||
<!-- Please describe concisely the feature you want to add. -->
|
||||
|
||||
**Version**
|
||||
- [ ] I have checked releases, and the feature is missing in the latest patch version of `v2`.
|
||||
|
||||
**Underlying issue**
|
||||
<!-- Please describe the issue this would solve. -->
|
||||
|
||||
**Describe alternatives**
|
||||
<!-- Please mention any alternative solutions you've considered. -->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
||||
|
||||
**Are you willing to submit a PR?**
|
||||
<!-- We accept pull requests targeting the develop branch. -->
|
58
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
58
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
name: Feature request
|
||||
description: Suggest a new feature
|
||||
title: "Feature: "
|
||||
labels: ["enhancement"]
|
||||
assignees: ["shivammathur"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Please fill out the sections below to help us understand your new feature proposal."
|
||||
|
||||
- type: textarea
|
||||
id: feature-description
|
||||
attributes:
|
||||
label: "Describe the feature"
|
||||
placeholder: "A clear and concise description of what you want and why."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: version-check
|
||||
attributes:
|
||||
label: "Please check the latest release"
|
||||
options:
|
||||
- label: "I have checked releases, and the feature is missing in the latest patch version of `v2`."
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: underlying-issue
|
||||
attributes:
|
||||
label: "Underlying issue"
|
||||
placeholder: "Please describe the issue this would solve."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: "Describe alternatives"
|
||||
placeholder: "Please mention any alternative solutions you've considered."
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: "Additional context"
|
||||
placeholder: "Drag and drop images or paste any additional information here..."
|
||||
|
||||
- type: dropdown
|
||||
id: willing-to-submit-pr
|
||||
attributes:
|
||||
label: "Are you willing to submit a PR?"
|
||||
description: "We accept pull requests targeting the develop branch."
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
64
.github/workflows/docs.yml
vendored
64
.github/workflows/docs.yml
vendored
@ -15,14 +15,35 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-22.04, ubuntu-20.04, windows-2022, macos-12]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, macos-13]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
- name: Create for Linux and macOS
|
||||
tools: none
|
||||
- name: Create file with all extensions for Linux and macOS
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
if: matrix.operating-system != 'windows-2022'
|
||||
run: |
|
||||
php -m >> "$file.all"
|
||||
- name: Create file with all extensions for Windows
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
if: matrix.operating-system == 'windows-2022'
|
||||
run: |
|
||||
php -m | Out-File -FilePath "$env:file.all" -Append
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: none
|
||||
tools: none
|
||||
- name: Create final file for Linux and macOS
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
@ -31,10 +52,20 @@ jobs:
|
||||
echo "## PHP $version" >> "$file"
|
||||
printf "\n" >> "$file"
|
||||
echo "\`\`\`" >> "$file"
|
||||
php -m >> "$file"
|
||||
php -m >> "$file.builtin"
|
||||
while IFS= read -r line; do
|
||||
if [[ $line == [* || -z "${line// }" ]]; then
|
||||
echo "$line" >> "$file"
|
||||
elif grep -q "^$line" "$file.builtin"; then
|
||||
echo "$line (builtin)" >> "$file"
|
||||
else
|
||||
echo "$line (shared)" >> "$file"
|
||||
fi
|
||||
done < "$file.all"
|
||||
echo "\`\`\`" >> "$file"
|
||||
printf "\n" >> "$file"
|
||||
- name: Create for Windows
|
||||
rm "$file.all" "$file.builtin"
|
||||
- name: Create final file for Windows
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
@ -42,8 +73,19 @@ jobs:
|
||||
run: |
|
||||
Write-Output "## PHP ${{ matrix.php-versions }}`n" | Out-File -FilePath "$env:file"
|
||||
Write-Output "``````" | Out-File -FilePath "$env:file" -Append
|
||||
php -m | Out-File -FilePath "$env:file" -Append
|
||||
php -m | Out-File -FilePath "$env:file.builtin" -Append
|
||||
Get-Content "$env:file.all" | ForEach-Object {
|
||||
if ($_.startsWith('[') -or -not $_.trim()) {
|
||||
Write-Output "$_" | Out-File -FilePath "$env:file" -Append
|
||||
} elseif ($_ -in (Get-Content "$env:file.builtin")) {
|
||||
Write-Output "$_ (builtin)" | Out-File -FilePath "$env:file" -Append
|
||||
} else {
|
||||
Write-Output "$_ (shared)" | Out-File -FilePath "$env:file" -Append
|
||||
}
|
||||
}
|
||||
Write-Output "```````n" | Out-File -FilePath "$env:file" -Append
|
||||
Remove-Item "$env:file.all" -Force
|
||||
Remove-Item "$env:file.builtin" -Force
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@ -72,12 +114,12 @@ jobs:
|
||||
git config --local user.name "${{ github.repository_owner }}"
|
||||
- name: Combine
|
||||
run: |
|
||||
for os in ubuntu-22.04 ubuntu-20.04 windows-2022 windows-2019 macos-11 macos-12 macos-13; do
|
||||
for os in ubuntu-24.04 ubuntu-22.04 ubuntu-20.04 windows-2022 windows-2019 macos-13 macos-14 macos-15; do
|
||||
echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md
|
||||
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4; do
|
||||
if [[ "$os" = "macos-11" || "$os" = "macos-13" ]]; then
|
||||
cat lists/php"$version"-macos-12.md >> Php-extensions-loaded-on-"$os".md
|
||||
elif [ "$os" = "windows-2019" ]; then
|
||||
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5; do
|
||||
if [[ "${os%-*}" = "macos" ]]; then
|
||||
cat lists/php"$version"-macos-13.md >> Php-extensions-loaded-on-"$os".md
|
||||
elif [ "${os%-*}" = "windows" ]; then
|
||||
cat lists/php"$version"-windows-2022.md >> Php-extensions-loaded-on-"$os".md
|
||||
else
|
||||
cat lists/php"$version"-"$os".md >> Php-extensions-loaded-on-"$os".md
|
||||
|
6
.github/workflows/node.yml
vendored
6
.github/workflows/node.yml
vendored
@ -33,10 +33,10 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Setup Node.js 16.x
|
||||
- name: Setup Node.js 20.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 20.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
@ -54,7 +54,7 @@ jobs:
|
||||
run: npm audit
|
||||
|
||||
- name: Send Coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage/lcov.info
|
||||
|
6
.github/workflows/php.yml
vendored
6
.github/workflows/php.yml
vendored
@ -28,10 +28,10 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-22.04, ubuntu-20.04, windows-2019, macos-latest]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, macos-13]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
|
||||
include:
|
||||
- operating-system: ubuntu-22.04
|
||||
- operating-system: ubuntu-24.04
|
||||
php-versions: ''
|
||||
php-version-file: 'php-version-file'
|
||||
env:
|
||||
|
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '20.x'
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Install dependencies and add lib
|
||||
|
115
README.md
115
README.md
@ -10,7 +10,7 @@
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</p>
|
||||
<p align="center">
|
||||
<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>
|
||||
@ -70,27 +70,30 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
||||
|
||||
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
||||
|---------------------|------------------------------------|------------------------|
|
||||
| Ubuntu 24.04 | `ubuntu-24.04` | `PHP 8.3` |
|
||||
| Ubuntu 22.04 | `ubuntu-latest` or `ubuntu-22.04` | `PHP 8.1` |
|
||||
| Ubuntu 20.04 | `ubuntu-20.04` | `PHP 7.4` to `PHP 8.3` |
|
||||
| Windows Server 2025 | `windows-2025` | `PHP 8.3` |
|
||||
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.3` |
|
||||
| Windows Server 2019 | `windows-2019` | `PHP 8.3` |
|
||||
| macOS Sonoma 14.x | `macos-14` | - |
|
||||
| macOS Sequoia 15.x | `macos-15` | - |
|
||||
| macOS Sonoma 14.x | `macos-latest` or `macos-14` | - |
|
||||
| macOS Ventura 13.x | `macos-13` | `PHP 8.3` |
|
||||
| macOS Monterey 12.x | `macos-latest` or `macos-12` | `PHP 8.3` |
|
||||
|
||||
### Self-Hosted Runners
|
||||
|
||||
| Host OS/Virtual environment | YAML workflow label |
|
||||
|----------------------------------|----------------------------|
|
||||
| Ubuntu 24.04 | `self-hosted` or `Linux` |
|
||||
| Ubuntu 22.04 | `self-hosted` or `Linux` |
|
||||
| Ubuntu 20.04 | `self-hosted` or `Linux` |
|
||||
| Debian 12 | `self-hosted` or `Linux` |
|
||||
| Debian 11 | `self-hosted` or `Linux` |
|
||||
| Debian 10 | `self-hosted` or `Linux` |
|
||||
| Windows 7 and newer | `self-hosted` or `Windows` |
|
||||
| Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
|
||||
| macOS Sequoia 15.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
| macOS Sonoma 14.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
| macOS Ventura 13.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
| macOS Monterey 12.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
|
||||
- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
|
||||
- Operating systems based on the above Ubuntu and Debian versions are also supported on best effort basis.
|
||||
@ -100,8 +103,9 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
||||
|
||||
On all supported OS/Platforms the following PHP versions can be set up as per the runner.
|
||||
|
||||
- PHP 5.3 to PHP 8.4 on GitHub-hosted runners.
|
||||
- PHP 5.6 to PHP 8.4 on self-hosted runners.
|
||||
- PHP 5.3 to PHP 8.5 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
|
||||
- PHP 5.6 to PHP 8.5 on GitHub-hosted macOS ARM64 runners (macos-14).
|
||||
- PHP 5.6 to PHP 8.5 on self-hosted runners.
|
||||
|
||||
| PHP Version | Stability | Release Support | Runner Support |
|
||||
|-------------|-----------|-----------------------|--------------------------------|
|
||||
@ -118,10 +122,11 @@ On all supported OS/Platforms the following PHP versions can be set up as per th
|
||||
| `8.1` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.2` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.3` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.4` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.5` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
||||
|
||||
**Notes:**
|
||||
- Specifying `8.4` in `php-version` input installs a nightly build of `PHP 8.4.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
|
||||
- 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.
|
||||
- To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
|
||||
|
||||
## :heavy_plus_sign: PHP Extension Support
|
||||
@ -134,7 +139,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with PECL extension
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
extensions: imagick, swoole
|
||||
```
|
||||
|
||||
@ -162,7 +167,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with pre-release PECL extension
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
extensions: xdebug-beta
|
||||
```
|
||||
|
||||
@ -174,7 +179,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP and disable opcache
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
extensions: :opcache
|
||||
```
|
||||
|
||||
@ -186,7 +191,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP without any shared extensions except mbstring
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
extensions: none, mbstring
|
||||
```
|
||||
|
||||
@ -196,7 +201,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with intl
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
extensions: intl-70.1
|
||||
```
|
||||
|
||||
@ -213,7 +218,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with fail-fast
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
extensions: oci8
|
||||
env:
|
||||
fail-fast: true
|
||||
@ -223,13 +228,13 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
|
||||
These tools can be set up globally using the `tools` input. It accepts a string in csv-format.
|
||||
|
||||
[`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cs2pr`], [`deployer`], [`flex`], [`grpc_php_plugin`], [`infection`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
||||
[`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with tools
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: php-cs-fixer, phpunit
|
||||
```
|
||||
|
||||
@ -239,7 +244,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP with tools
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: vimeo/psalm
|
||||
```
|
||||
|
||||
@ -259,8 +264,8 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP with tools
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
tools: php-cs-fixer:3.39, phpunit:10.4
|
||||
php-version: '8.4'
|
||||
tools: php-cs-fixer:3.64, phpunit:11.4
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
@ -271,7 +276,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP with composer v2
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: composer:v2
|
||||
```
|
||||
|
||||
@ -281,7 +286,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP without composer
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: none
|
||||
```
|
||||
|
||||
@ -297,7 +302,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP with fail-fast
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: deployer
|
||||
env:
|
||||
fail-fast: true
|
||||
@ -314,7 +319,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP with composer and custom process timeout
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
COMPOSER_PROCESS_TIMEOUT: 300
|
||||
```
|
||||
@ -330,7 +335,7 @@ Runs on all [PHP versions supported](#tada-php-support "List of PHP versions sup
|
||||
- name: Setup PHP with Xdebug
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
coverage: xdebug
|
||||
```
|
||||
|
||||
@ -358,7 +363,7 @@ Runs on PHP 7.1 and newer PHP versions.
|
||||
- name: Setup PHP with PCOV
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
ini-values: pcov.directory=api #optional, see above for usage.
|
||||
coverage: pcov
|
||||
```
|
||||
@ -388,7 +393,7 @@ Disable coverage for these reasons:
|
||||
- name: Setup PHP with no coverage driver
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
coverage: none
|
||||
```
|
||||
|
||||
@ -401,16 +406,18 @@ Disable coverage for these reasons:
|
||||
#### `php-version` (optional)
|
||||
|
||||
- Specify the PHP version you want to set up.
|
||||
- Accepts a `string`. For example `'8.3'`.
|
||||
- Accepts a `string`. For example `'8.4'`.
|
||||
- Accepts `lowest` to set up the lowest supported PHP version.
|
||||
- Accepts `highest` or `latest` to set up the latest stable PHP version.
|
||||
- Accepts `nightly` to set up a nightly build from the master branch of PHP.
|
||||
- Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version.
|
||||
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
|
||||
- See [PHP support](#tada-php-support) for the supported PHP versions.
|
||||
- If not specified, it looks for the following in order:
|
||||
- The `php-version-file` input if it exists
|
||||
- A `composer.lock` file and the `platform-overrides.php` value
|
||||
- A `composer.json` file and the `config.platform.php` value
|
||||
- If the `composer.lock` or `composer.json` file is in a sub-directory in your repository, please specify the subdirectory path in `COMPOSER_PROJECT_DIR` env.
|
||||
|
||||
#### `php-version-file` (optional)
|
||||
|
||||
@ -418,6 +425,7 @@ Disable coverage for these reasons:
|
||||
- Accepts a `string`. For example `'.phpenv-version'`.
|
||||
- See [PHP support](#tada-php-support) for the supported PHP versions.
|
||||
- By default, `.php-version` file is used.
|
||||
- The file either have the PHP version as its content, or follow the asdf `.tool-versions` format.
|
||||
- If not specified and the default `.php-version` file is not found, the latest stable PHP version is set up.
|
||||
|
||||
#### `extensions` (optional)
|
||||
@ -465,7 +473,7 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
|
||||
id: setup-php
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
|
||||
- name: Print PHP version
|
||||
run: echo ${{ steps.setup-php.outputs.php-version }}
|
||||
@ -507,7 +515,7 @@ steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
extensions: mbstring, intl
|
||||
ini-values: post_max_size=256M, max_execution_time=180
|
||||
coverage: xdebug
|
||||
@ -525,12 +533,12 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
||||
php-versions: ['8.1', '8.2', '8.3']
|
||||
php-versions: ['8.2', '8.3', '8.4']
|
||||
phpunit-versions: ['latest']
|
||||
include:
|
||||
- operating-system: 'ubuntu-latest'
|
||||
php-versions: '8.0'
|
||||
phpunit-versions: 9
|
||||
php-versions: '8.1'
|
||||
phpunit-versions: 10
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
@ -546,7 +554,7 @@ jobs:
|
||||
|
||||
### Nightly Build Setup
|
||||
|
||||
> Set up a nightly build of `PHP 8.4`.
|
||||
> Set up a nightly build of `PHP 8.5`.
|
||||
|
||||
- These PHP versions are currently in active development and might contain bugs and breaking changes.
|
||||
- Some user space extensions might not support this version currently.
|
||||
@ -556,7 +564,7 @@ steps:
|
||||
- name: Setup nightly PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
php-version: '8.5'
|
||||
extensions: mbstring
|
||||
ini-values: post_max_size=256M, max_execution_time=180
|
||||
coverage: xdebug
|
||||
@ -580,7 +588,7 @@ steps:
|
||||
- name: Setup PHP with debugging symbols
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
debug: true # specify true or false
|
||||
```
|
||||
@ -600,7 +608,7 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
phpts: ts # specify ts or nts
|
||||
```
|
||||
@ -617,7 +625,7 @@ jobs:
|
||||
- name: Setup PHP with latest versions
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
update: true # specify true or false
|
||||
```
|
||||
@ -632,14 +640,14 @@ To debug any issues, you can use the `verbose` tag instead of `v2`.
|
||||
- name: Setup PHP with logs
|
||||
uses: shivammathur/setup-php@verbose
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
```
|
||||
|
||||
### Multi-Arch Setup
|
||||
|
||||
> Set up PHP on multiple architecture on Ubuntu GitHub Runners.
|
||||
|
||||
- `PHP 5.6` to `PHP 8.3` are supported by `setup-php` on multiple architecture on `Ubuntu`.
|
||||
- `PHP 5.6` to `PHP 8.4` are supported by `setup-php` on multiple architecture on `Ubuntu`.
|
||||
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` installed for `setup-php`.
|
||||
- Currently, for `ARM` based setup, you will need [self-hosted runners](#self-hosted-setup).
|
||||
|
||||
@ -655,7 +663,7 @@ jobs:
|
||||
- name: Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
```
|
||||
|
||||
### Self Hosted Setup
|
||||
@ -677,7 +685,7 @@ jobs:
|
||||
runs-on: self-hosted
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||
name: PHP ${{ matrix.php-versions }}
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
@ -705,7 +713,7 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
```
|
||||
|
||||
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
|
||||
@ -716,6 +724,9 @@ Choose the image tag which matches the `runs-on` property in your workflow. For
|
||||
# For runs-on: ubuntu-latest
|
||||
act -P ubuntu-latest=shivammathur/node:latest
|
||||
|
||||
# For runs-on: ubuntu-24.04
|
||||
act -P ubuntu-24.04=shivammathur/node:2404
|
||||
|
||||
# For runs-on: ubuntu-22.04
|
||||
act -P ubuntu-22.04=shivammathur/node:2204
|
||||
|
||||
@ -738,7 +749,7 @@ For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
|
||||
- name: Setup PHP with JIT in tracing mode
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
coverage: none
|
||||
ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M
|
||||
```
|
||||
@ -791,7 +802,7 @@ The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHU
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
@ -804,7 +815,7 @@ If you use Private Packagist for your private composer dependencies, you can set
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
|
||||
```
|
||||
@ -818,7 +829,7 @@ Please refer to the authentication section in [`composer documentation`](https:/
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
COMPOSER_AUTH_JSON: |
|
||||
{
|
||||
@ -841,7 +852,7 @@ Put the code in the run property of a step and specify the shell as `php {0}`.
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
|
||||
- name: Run PHP code
|
||||
shell: php {0}
|
||||
@ -881,7 +892,7 @@ PHPStan supports error reporting in GitHub Actions, so it does not require probl
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: phpstan
|
||||
|
||||
- name: Run PHPStan
|
||||
@ -896,7 +907,7 @@ Psalm supports error reporting in GitHub Actions with an output format `github`.
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: psalm
|
||||
|
||||
- name: Run Psalm
|
||||
@ -914,7 +925,7 @@ For examples refer to the [cs2pr documentation](https://github.com/staabm/annota
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
php-version: '8.4'
|
||||
tools: cs2pr, phpcs
|
||||
|
||||
- name: Run phpcs
|
||||
@ -1043,12 +1054,14 @@ These companies generously provide setup-php their products and services to aid
|
||||
[`churn`]: https://github.com/bmitch/churn-php
|
||||
[`codeception`]: https://codeception.com/
|
||||
[`composer`]: https://getcomposer.org/
|
||||
[`composer-dependency-analyser`]: https://github.com/shipmonk-rnd/composer-dependency-analyser
|
||||
[`composer-normalize`]: https://github.com/ergebnis/composer-normalize
|
||||
[`composer-prefetcher`]: https://github.com/narrowspark/automatic-composer-prefetcher
|
||||
[`composer-require-checker`]: https://github.com/maglnet/ComposerRequireChecker
|
||||
[`composer-unused`]: https://github.com/composer-unused/composer-unused
|
||||
[`cs2pr`]: https://github.com/staabm/annotate-pull-request-from-checkstyle
|
||||
[`deployer`]: https://deployer.org/
|
||||
[`ecs`]: https://github.com/easy-coding-standard/easy-coding-standard
|
||||
[`flex`]: https://flex.symfony.com/
|
||||
[`grpc_php_plugin`]: https://grpc.io/
|
||||
[`infection`]: https://infection.github.io/
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as fetch from '../src/fetch';
|
||||
import nock = require('nock');
|
||||
import nock from 'nock';
|
||||
|
||||
it('checking fetch', async () => {
|
||||
const host_url = 'https://example.com';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as packagist from '../src/packagist';
|
||||
import nock = require('nock');
|
||||
import nock from 'nock';
|
||||
|
||||
describe('search function', () => {
|
||||
const mockResponse = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import fs = require('fs');
|
||||
import * as fs from 'fs';
|
||||
import * as tools from '../src/tools';
|
||||
|
||||
interface IData {
|
||||
@ -434,7 +434,7 @@ describe('Tools tests', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
'behat, blackfire, blackfire-player, churn, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, flex, grpc_php_plugin:1.2.3, infection, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, vapor-cli, wp-cli',
|
||||
'behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, vapor-cli, wp-cli',
|
||||
[
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_composer_tool behat behat behat/ scoped',
|
||||
@ -442,6 +442,7 @@ describe('Tools tests', () => {
|
||||
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
|
||||
'add_tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||
'add_tool https://github.com/ergebnis/composer-normalize/releases/latest/download/composer-normalize.phar composer-normalize "-V"',
|
||||
'add_composer_tool composer-dependency-analyser composer-dependency-analyser shipmonk/ scoped',
|
||||
'add_composer_tool composer-require-checker composer-require-checker maglnet/ scoped',
|
||||
'add_tool https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar composer-unused "-V"',
|
||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr "-V"',
|
||||
@ -468,7 +469,8 @@ describe('Tools tests', () => {
|
||||
'add_composer_tool rector rector rector/ scoped',
|
||||
'add_symfony latest',
|
||||
'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
|
||||
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
||||
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
||||
'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped'
|
||||
]
|
||||
]
|
||||
])('checking addTools on darwin', async (tools_csv, scripts) => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import fs = require('fs');
|
||||
import fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as utils from '../src/utils';
|
||||
|
||||
@ -285,6 +285,14 @@ describe('Utils tests', () => {
|
||||
delete process.env['php-version-file'];
|
||||
delete process.env['php-version'];
|
||||
|
||||
existsSync.mockReturnValue(true);
|
||||
readFileSync.mockReturnValue('ruby 1.2.3\nphp 8.4.2\nnode 20.1.2');
|
||||
expect(await utils.readPHPVersion()).toBe('8.4.2');
|
||||
|
||||
existsSync.mockReturnValue(true);
|
||||
readFileSync.mockReturnValue('setup-php');
|
||||
expect(await utils.readPHPVersion()).toBe('setup-php');
|
||||
|
||||
existsSync.mockReturnValueOnce(false).mockReturnValueOnce(true);
|
||||
readFileSync.mockReturnValue(
|
||||
'{ "platform-overrides": { "php": "7.3.25" } }'
|
||||
|
4
dist/index.js
vendored
4
dist/index.js
vendored
File diff suppressed because one or more lines are too long
51
eslint.config.mjs
Normal file
51
eslint.config.mjs
Normal file
@ -0,0 +1,51 @@
|
||||
import {fixupConfigRules, fixupPluginRules} from '@eslint/compat';
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
||||
import jest from 'eslint-plugin-jest';
|
||||
import globals from 'globals';
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import tsParser from '@typescript-eslint/parser';
|
||||
import path from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import js from '@eslint/js';
|
||||
import {FlatCompat} from '@eslint/eslintrc';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
|
||||
export default [
|
||||
...fixupConfigRules(
|
||||
compat.extends(
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:import/errors',
|
||||
'plugin:import/warnings',
|
||||
'plugin:import/typescript',
|
||||
'plugin:prettier/recommended',
|
||||
'prettier'
|
||||
)
|
||||
),
|
||||
{
|
||||
plugins: {
|
||||
'@typescript-eslint': fixupPluginRules(typescriptEslint),
|
||||
jest
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.jest
|
||||
},
|
||||
|
||||
parser: tsParser,
|
||||
ecmaVersion: 2021,
|
||||
sourceType: 'module'
|
||||
}
|
||||
}
|
||||
];
|
8633
package-lock.json
generated
8633
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "2.30.2",
|
||||
"version": "2.32.0",
|
||||
"private": false,
|
||||
"description": "Setup PHP for use with GitHub Actions",
|
||||
"main": "lib/install.js",
|
||||
@ -34,29 +34,32 @@
|
||||
"author": "shivammathur",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"compare-versions": "^6.1.0"
|
||||
"compare-versions": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^20.12.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
||||
"@typescript-eslint/parser": "^7.4.0",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"eslint": "^8.57.0",
|
||||
"@eslint/compat": "^1.2.4",
|
||||
"@eslint/js": "9.17.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.10.2",
|
||||
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
||||
"@typescript-eslint/parser": "^8.18.2",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "9.17.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-jest": "^28.10.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"globals": "^15.14.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"nock": "^13.5.4",
|
||||
"prettier": "^3.2.5",
|
||||
"nock": "^13.5.6",
|
||||
"prettier": "^3.4.2",
|
||||
"simple-git-hooks": "^2.11.1",
|
||||
"ts-jest": "^29.1.2",
|
||||
"typescript": "^5.4.3"
|
||||
"ts-jest": "^29.2.5",
|
||||
"typescript": "^5.7.2"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||
|
@ -6,6 +6,7 @@ couchbase=30
|
||||
decimal=30
|
||||
ds=30
|
||||
event=30
|
||||
ev=30
|
||||
grpc=30
|
||||
http=25
|
||||
pecl_http=25
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"lowest": "8.1",
|
||||
"highest": "8.3",
|
||||
"latest": "8.3",
|
||||
"nightly": "8.4",
|
||||
"highest": "8.4",
|
||||
"latest": "8.4",
|
||||
"nightly": "8.5",
|
||||
"5.x": "5.6",
|
||||
"7.x": "7.4",
|
||||
"8.x": "8.3"
|
||||
"8.x": "8.4"
|
||||
}
|
||||
|
@ -16,6 +16,11 @@
|
||||
"version_prefix": "",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"composer-dependency-analyser": {
|
||||
"type": "composer",
|
||||
"repository": "shipmonk/composer-dependency-analyser",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"composer-unused": {
|
||||
"type": "phar",
|
||||
"repository": "composer-unused/composer-unused",
|
||||
@ -318,5 +323,11 @@
|
||||
"extension": ".phar",
|
||||
"version_parameter": "--version",
|
||||
"version_prefix": "v"
|
||||
},
|
||||
"easy-coding-standard": {
|
||||
"type": "composer",
|
||||
"alias": "ecs",
|
||||
"repository": "symplify/easy-coding-standard",
|
||||
"scope": "scoped"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,26 +31,26 @@ export async function addExtensionDarwin(
|
||||
case /.+-.+\/.+@.+/.test(extension):
|
||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||
return;
|
||||
// match 7.4relay...8.3relay
|
||||
// match 7.4relay...8.5relay
|
||||
// match 5.3blackfire...8.3blackfire
|
||||
// match 5.3blackfire-(semver)...8.3blackfire-(semver)
|
||||
// match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
|
||||
// match 5.3ioncube...7.4ioncube
|
||||
// match 5.3ioncube...8.2ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.3phalcon5
|
||||
// match 7.0zephir_parser...8.2zephir_parser
|
||||
case /^(7\.4|8\.[0-3])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||
// match 7.0zephir_parser...8.3zephir_parser
|
||||
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
extension
|
||||
):
|
||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(version_extension):
|
||||
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-3])phalcon5?/.test(
|
||||
version_extension
|
||||
):
|
||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||
case /^(7\.[0-4]|8\.[0-2])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
case /^(7\.[0-4]|8\.[0-3])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
add_script += await utils.customPackage(
|
||||
@ -137,21 +137,21 @@ export async function addExtensionWindows(
|
||||
// match 5.3blackfire...8.3blackfire
|
||||
// match 5.3blackfire-(semver)...8.3blackfire-(semver)
|
||||
// match pdo_oci and oci8
|
||||
// match 5.3ioncube...7.4ioncube
|
||||
// match 5.3ioncube...8.2ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.3phalcon5
|
||||
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
|
||||
// match 7.0zephir_parser...8.2zephir_parser
|
||||
// match 7.0zephir_parser...8.3zephir_parser
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
|
||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(version_extension):
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-3])phalcon5?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^(7\.[1-4]|8\.1)(pecl_)?http/.test(version_extension):
|
||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||
case /^(7\.[0-4]|8\.[0-2])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
case /^(7\.[0-4]|8\.[0-3])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
add_script += await utils.customPackage(
|
||||
@ -263,15 +263,15 @@ export async function addExtensionLinux(
|
||||
case /.+-.+\/.+@.+/.test(extension):
|
||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||
return;
|
||||
// match 7.4relay...8.3relay
|
||||
// match 7.4relay...8.5relay
|
||||
// match 5.3blackfire...8.3blackfire
|
||||
// match 5.3blackfire-(semver)...8.3blackfire-(semver)
|
||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
||||
// match 5.3ioncube...7.4ioncube
|
||||
// match 5.3ioncube...8.2ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.3phalcon5
|
||||
// match 7.0zephir_parser...8.2zephir_parser
|
||||
case /^(7\.4|8\.[0-3])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||
// match 7.0zephir_parser...8.3zephir_parser
|
||||
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
@ -282,12 +282,12 @@ export async function addExtensionLinux(
|
||||
extension
|
||||
):
|
||||
case /(?<!5\.[3-5])intl-\d+\.\d+$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(version_extension):
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-3])phalcon5?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||
case /^(7\.[0-4]|8\.[0-2])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
case /^(7\.[0-4]|8\.[0-3])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
add_script += await utils.customPackage(
|
||||
|
@ -164,10 +164,11 @@ add_php() {
|
||||
suffix="$(get_php_formula_suffix)"
|
||||
php_formula="shivammathur/php/php@$version$suffix"
|
||||
if [[ "$existing_version" != "false" && -z "$suffix" ]]; then
|
||||
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
||||
([ "$action" = "upgrade" ] && brew upgrade -f --overwrite "$php_formula") || brew unlink "$php_formula"
|
||||
else
|
||||
brew install -f "$php_formula"
|
||||
brew install -f --overwrite "$php_formula"
|
||||
fi
|
||||
sudo chown -R "$(id -un)":"$(id -gn)" "$brew_prefix"
|
||||
brew link --force --overwrite "$php_formula"
|
||||
}
|
||||
|
||||
@ -212,6 +213,8 @@ get_scan_dir() {
|
||||
setup_php() {
|
||||
step_log "Setup PHP"
|
||||
php_config="$(command -v php-config 2>/dev/null)"
|
||||
update=true
|
||||
check_pre_installed
|
||||
existing_version=$(get_brewed_php)
|
||||
if [[ "$version" =~ ${old_versions:?} ]]; then
|
||||
run_script "php5-darwin" "${version/./}" >/dev/null 2>&1
|
||||
@ -219,15 +222,16 @@ setup_php() {
|
||||
elif [ "$existing_version" != "$version" ]; then
|
||||
add_php "install" "$existing_version" >/dev/null 2>&1
|
||||
status="Installed"
|
||||
elif [ "$existing_version" = "$version" ] && [ "${update:?}" = "true" ]; then
|
||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||
status="Updated to"
|
||||
else
|
||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||
status="Updated to"
|
||||
elif [ "$existing_version" = "$version" ]; then
|
||||
if [ "${update:?}" = "true" ]; then
|
||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||
status="Updated to"
|
||||
else
|
||||
status="Found"
|
||||
fi
|
||||
fi
|
||||
php_config="$(command -v php-config)"
|
||||
ext_dir="$(grep 'extension_dir=' "$php_config" | cut -d "'" -f 2)"
|
||||
ext_dir="$(sed -n "s/.*extension_dir=['\"]\(.*\)['\"].*/\1/p" "$php_config")"
|
||||
ini_dir="$(php_ini_path)"
|
||||
scan_dir="$(get_scan_dir)"
|
||||
ini_file="$ini_dir"/php.ini
|
||||
@ -248,7 +252,7 @@ setup_php() {
|
||||
}
|
||||
|
||||
# Variables
|
||||
version=${1:-'8.3'}
|
||||
version=${1:-'8.4'}
|
||||
ini=${2:-'production'}
|
||||
src=${0%/*}/..
|
||||
php_formula=shivammathur/php/php@"$version"
|
||||
@ -256,7 +260,6 @@ scripts="$src"/scripts
|
||||
ext_tap=shivammathur/homebrew-extensions
|
||||
php_tap=shivammathur/homebrew-php
|
||||
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
||||
export HOMEBREW_DEVELOPER=1
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
|
@ -66,7 +66,7 @@ Function Enable-Extension() {
|
||||
}
|
||||
|
||||
# Function to add custom built PHP extension for nightly builds.
|
||||
Function Add-NightlyExtension {
|
||||
Function Add-ExtensionFromGithub {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
@ -100,7 +100,7 @@ Function Add-Extension {
|
||||
$stability = 'stable',
|
||||
[Parameter(Position = 2, Mandatory = $false)]
|
||||
[ValidateNotNull()]
|
||||
[ValidatePattern('^\d+(\.\d+){0,2}$')]
|
||||
[ValidatePattern('^\d+(\.\d+){0,3}$')]
|
||||
[string]
|
||||
$extension_version = ''
|
||||
)
|
||||
@ -123,7 +123,7 @@ Function Add-Extension {
|
||||
}
|
||||
else {
|
||||
if(($version -match $nightly_versions) -and (Select-String -Path $src\configs\windows_extensions -Pattern $extension -SimpleMatch -Quiet)) {
|
||||
Add-NightlyExtension $extension
|
||||
Add-ExtensionFromGithub $extension
|
||||
} else {
|
||||
# Patch till DLLs for PHP 8.1 and above are released as stable.
|
||||
$minimumStability = $stability
|
||||
@ -136,6 +136,10 @@ Function Add-Extension {
|
||||
{
|
||||
$params["Version"] = $extension_version
|
||||
}
|
||||
# If extension for a different version exists
|
||||
if(Test-Path $ext_dir\php_$extension.dll) {
|
||||
Move-Item $ext_dir\php_$extension.dll $ext_dir\php_$extension.bak.dll -Force
|
||||
}
|
||||
Install-PhpExtension @params
|
||||
Set-ExtensionPrerequisites $extension
|
||||
}
|
||||
@ -257,4 +261,4 @@ Function Disable-AllShared() {
|
||||
# Function to handle request to add PECL.
|
||||
Function Add-Pecl() {
|
||||
Add-Log $tick "PECL" "Use extensions input to setup PECL extensions on windows"
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,10 @@ add_blackfire() {
|
||||
status='Enabled'
|
||||
if ! shared_extension blackfire; then
|
||||
status='Installed and enabled'
|
||||
arch="$(uname -m)"
|
||||
arch_name="amd64"
|
||||
[[ "$arch" = "aarch64" || "$arch" = "arm64" ]] && arch_name="arm64"
|
||||
[ "${ts:?}" = 'zts' ] && no_dot_version="${no_dot_version}-zts"
|
||||
if [ "$extension_version" = "blackfire" ]; then
|
||||
if [[ ${version:?} =~ 5.[3-6] ]]; then
|
||||
extension_version='1.50.0'
|
||||
@ -15,10 +19,14 @@ add_blackfire() {
|
||||
extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3)
|
||||
fi
|
||||
fi
|
||||
get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_amd64-php-"$no_dot_version".so >/dev/null 2>&1
|
||||
get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_"$arch_name"-php-"$no_dot_version".so >/dev/null 2>&1
|
||||
fi
|
||||
if [ -e "${ext_dir:?}/blackfire.so" ]; then
|
||||
disable_extension xdebug >/dev/null 2>&1
|
||||
disable_extension pcov >/dev/null 2>&1
|
||||
enable_extension blackfire extension
|
||||
add_extension_log blackfire "$status"
|
||||
else
|
||||
add_extension_log blackfire "Could not install blackfire on PHP ${semver:?}"
|
||||
fi
|
||||
disable_extension xdebug >/dev/null 2>&1
|
||||
disable_extension pcov >/dev/null 2>&1
|
||||
enable_extension blackfire extension
|
||||
add_extension_log blackfire "$status"
|
||||
}
|
||||
|
@ -7,15 +7,27 @@ add_couchbase_clibs() {
|
||||
else
|
||||
release=$(get -s -n "" "$trunk"/latest | grep -Eo -m 1 "[0-9]+\.[0-9]+\.[0-9]+" | head -n 1)
|
||||
fi
|
||||
[ "$VERSION_ID" = "22.04" ] && vid=20.04 || vid="$VERSION_ID"
|
||||
[ "$VERSION_CODENAME" = "jammy" ] && vcn=focal || vcn="$VERSION_CODENAME"
|
||||
[ "$VERSION_ID" = "24.04" ] && vid=22.04 || vid="$VERSION_ID"
|
||||
[ "$VERSION_CODENAME" = "noble" ] && vcn=jammy || vcn="$VERSION_CODENAME"
|
||||
deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu${vid/./}_${vcn}_amd64.tar"
|
||||
get -q -n /tmp/libcouchbase.tar "$deb_url"
|
||||
if ! [ -e /tmp/libcouchbase.tar ] || ! file /tmp/libcouchbase.tar | grep -q 'tar archive'; then
|
||||
deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu2004_focal_amd64.tar"
|
||||
get -q -n /tmp/libcouchbase.tar "$deb_url"
|
||||
add_old_libssl
|
||||
fi
|
||||
sudo tar -xf /tmp/libcouchbase.tar -C /tmp
|
||||
install_packages libev4 libevent-dev
|
||||
sudo dpkg -i /tmp/libcouchbase-*/*.deb
|
||||
}
|
||||
|
||||
add_old_libssl() {
|
||||
if [[ "$VERSION_ID" = "24.04" ]]; then
|
||||
get -q -n /tmp/libssl.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
|
||||
[ -e /tmp/libssl.deb ] && sudo dpkg -i /tmp/libssl.deb || add_extension_log "couchbase" "Could not install libssl1.1"
|
||||
fi
|
||||
}
|
||||
|
||||
add_couchbase_cxxlibs() {
|
||||
if [ "${runner:?}" = "self-hosted" ]; then
|
||||
add_list cmake https://apt.kitware.com/ubuntu/ https://apt.kitware.com/keys/kitware-archive-latest.asc "$VERSION_CODENAME" main
|
||||
@ -33,7 +45,7 @@ get_couchbase_version() {
|
||||
elif [ "${version:?}" = '7.3' ]; then
|
||||
echo couchbase-3.2.2
|
||||
elif [ "${version:?}" = '7.4' ]; then
|
||||
echo couchbase-4.1.0
|
||||
echo couchbase-4.1.1
|
||||
else
|
||||
echo couchbase
|
||||
fi
|
||||
|
@ -1,17 +1,21 @@
|
||||
add_firebird_client_darwin() {
|
||||
firebird_tag='R3_0_7'
|
||||
pkg_name=$(get -s -n "" https://api.github.com/repos/FirebirdSQL/firebird/releases/tags/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
|
||||
[ -z "$pkg_name" ] && pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/expanded_assets/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
|
||||
firebird_tag='v5.0.0'
|
||||
arch_name='x64'
|
||||
arch="$(uname -m)"
|
||||
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_name='arm64'
|
||||
pkg_name=$(get -s -n "" https://api.github.com/repos/FirebirdSQL/firebird/releases/tags/"$firebird_tag" | grep -Eo "Firebird-.*.-$arch_name.pkg" | head -n 1)
|
||||
[ -z "$pkg_name" ] && pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/expanded_assets/"$firebird_tag" | grep -Eo "Firebird-.*.-$arch_name.pkg" | head -n 1)
|
||||
get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
|
||||
sudo installer -pkg /tmp/firebird.pkg -target /
|
||||
sudo mkdir -p /opt/firebird/include /opt/firebird/lib
|
||||
sudo find /Library/Frameworks/Firebird.framework -name '*.h' -exec cp "{}" /opt/firebird/include \;
|
||||
sudo cp -a /Library/Frameworks/Firebird.framework/Headers/* /opt/firebird/include/
|
||||
sudo find /Library/Frameworks/Firebird.framework -name '*.dylib' -exec cp "{}" /opt/firebird/lib \;
|
||||
}
|
||||
|
||||
add_firebird_helper() {
|
||||
firebird_dir=$1
|
||||
tag="$(php_src_tag)"
|
||||
export PDO_FIREBIRD_CONFIGURE_PREFIX_OPTS="CFLAGS=-Wno-incompatible-function-pointer-types EXTRA_CFLAGS=-Wno-int-conversion"
|
||||
export PDO_FIREBIRD_CONFIGURE_OPTS="--with-pdo-firebird=$firebird_dir"
|
||||
export PDO_FIREBIRD_LINUX_LIBS="firebird-dev"
|
||||
export PDO_FIREBIRD_PATH="ext/pdo_firebird"
|
||||
|
@ -10,12 +10,25 @@ add_ioncube() {
|
||||
status='Enabled'
|
||||
if ! shared_extension ioncube; then
|
||||
status='Installed and enabled'
|
||||
os_name='lin' && [ "$(uname -s)" = "Darwin" ] && os_name='mac'
|
||||
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_name"_x86-64.tar.gz | tar -xzf - -C /tmp
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "${ext_dir:?}/ioncube.so"
|
||||
sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt
|
||||
arch="$(uname -m)"
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
[ "$arch" = "arm64" ] && os_suffix="dar_arm64" || os_suffix="mac_x86-64"
|
||||
else
|
||||
[[ "$arch" = "i386" || "$arch" = "i686" ]] && arch=x86
|
||||
[[ "$arch" = "x86_64" ]] && arch=x86-64
|
||||
os_suffix="lin_$arch"
|
||||
fi
|
||||
ts_part="" && [ "${ts:?}" = "zts" ] && ts_part="_ts"
|
||||
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_suffix".tar.gz | tar -xzf - -C /tmp
|
||||
loader_file=/tmp/ioncube/ioncube_loader_"${os_suffix%%_*}_${version:?}$ts_part".so
|
||||
if [ -e "$loader_file" ]; then
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"${os_suffix%%_*}_${version:?}$ts_part".so "${ext_dir:?}/ioncube.so"
|
||||
sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
fi
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
add_extension_log "ioncube" "$status"
|
||||
check_extension "ioncube" && add_license_log
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ Function Get-Oci8DLL() {
|
||||
return $_
|
||||
}
|
||||
}
|
||||
return $null
|
||||
}
|
||||
|
||||
# Function to install oci8 and pdo_oci.
|
||||
@ -62,22 +63,17 @@ Function Add-Oci() {
|
||||
try {
|
||||
$status = 'Enabled'
|
||||
Add-InstantClient
|
||||
if ($extension -eq "pdo_oci") {
|
||||
Enable-PhpExtension pdo_oci -Path $php_dir
|
||||
} else {
|
||||
if(-not(Test-Path $ext_dir\php_oci8.dll)) {
|
||||
$oci8DLL = Get-Oci8DLL
|
||||
if($oci8DLL) {
|
||||
Copy-Item -Path $oci8DLL -Destination $ext_dir\php_oci8.dll
|
||||
} else {
|
||||
$status = 'Installed and enabled'
|
||||
Get-File -Url (Get-Oci8Url) -OutFile $php_dir\oci8.zip
|
||||
Expand-Archive -Path $php_dir\oci8.zip -DestinationPath $ext_dir -Force
|
||||
}
|
||||
if($version -lt '8.4') {
|
||||
if($version -lt '5.6' -and $extension -eq 'oci8') {
|
||||
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
||||
} else {
|
||||
Enable-PhpExtension $extension -Path $php_dir
|
||||
}
|
||||
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
||||
} else {
|
||||
$status = 'Installed and enabled'
|
||||
Add-Extension $extension >$null 2>&1
|
||||
}
|
||||
Add-Log $tick $extension $status
|
||||
Add-ExtensionLog $extension $status
|
||||
Add-LicenseLog
|
||||
} catch {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
||||
|
@ -30,6 +30,10 @@ add_client() {
|
||||
sudo mv "$icdir"/* "$oracle_client"/
|
||||
done
|
||||
sudo ln -sf /opt/oracle/instantclient/*.$lib_ext* $libs
|
||||
if [ "$os" = "Linux" ]; then
|
||||
arch="$(uname -m)"
|
||||
[ -e "$libs/$arch"-linux-gnu/libaio.so.1t64 ] && sudo ln -sf "$libs/$arch"-linux-gnu/libaio.so.1t64 "$libs/$arch"-linux-gnu/libaio.so.1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
# Helper function to get phalcon version
|
||||
get_phalcon_version() {
|
||||
if [ "$extension" = "phalcon5" ]; then
|
||||
get_pecl_version phalcon stable 5
|
||||
if [ "${version:?}" = "7.4" ]; then
|
||||
echo '5.4.0'
|
||||
else
|
||||
get_pecl_version phalcon stable 5
|
||||
fi
|
||||
elif [ "$extension" = "phalcon4" ]; then
|
||||
echo '4.1.2'
|
||||
elif [ "$extension" = "phalcon3" ]; then
|
||||
|
@ -2,7 +2,11 @@
|
||||
get_relay_version() {
|
||||
local ext=$1
|
||||
if [[ "$ext" =~ ^relay$ ]]; then
|
||||
get -s -n "" "${relay_releases:?}"/latest 2<&1 | grep -m 1 -Eo "tag/(v[0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2
|
||||
if [ "${version:?}" = "7.4" ]; then
|
||||
echo 'v0.7.0'
|
||||
else
|
||||
get -s -n "" "${relay_releases:?}"/latest 2<&1 | grep -m 1 -Eo "tag/(v[0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2
|
||||
fi
|
||||
else
|
||||
relay_version="${ext##*-}"
|
||||
echo "v${relay_version/v//}"
|
||||
@ -40,6 +44,7 @@ change_library_paths() {
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libssl.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libssl.dylib "$ext_dir"/relay.so
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libcrypto.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libcrypto.dylib "$ext_dir"/relay.so
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libck.*dylib" | xargs)" "$brew_prefix"/opt/concurrencykit/lib/libck.dylib "$ext_dir"/relay.so
|
||||
fi
|
||||
}
|
||||
|
||||
@ -51,7 +56,7 @@ add_relay_dependencies() {
|
||||
if [ "$os" = "Darwin" ]; then
|
||||
. "${0%/*}"/tools/brew.sh
|
||||
configure_brew
|
||||
brew install hiredis lz4 zstd
|
||||
brew install hiredis lz4 zstd concurrencykit
|
||||
fi
|
||||
}
|
||||
|
||||
@ -92,8 +97,7 @@ enable_relay() {
|
||||
# Patch binary id in relay extension
|
||||
init_relay_binary_id() {
|
||||
if [ -e "${ext_dir:?}"/relay.so ]; then
|
||||
grep -aq 00000000 "${ext_dir:?}"/relay.so && \
|
||||
sudo LC_ALL=C sed -i.bak "s/00000000-0000-0000-0000-000000000000/$(uuidgen)/" "$ext_dir"/relay.so
|
||||
sudo LC_ALL=C sed -i.bak "s/00000000-0000-0000-0000-000000000000/$(uuidgen)/" "$ext_dir"/relay.so || true
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ add_extension_from_source() {
|
||||
patch_extension "$extension" >/dev/null 2>&1
|
||||
run_group "phpize" "phpize"
|
||||
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
||||
run_group "sudo make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
|
||||
run_group "sudo $prefix_opts make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
|
||||
run_group "sudo make install" "make install"
|
||||
enable_extension "$extension" "$prefix"
|
||||
fi
|
||||
|
@ -29,7 +29,7 @@ Function Get-SqlsrvReleaseUrl()
|
||||
}
|
||||
|
||||
# Function to add sqlsrv extension from GitHub.
|
||||
Function Add-SqlsrvFromGithub()
|
||||
Function Add-SqlsrvFromMSGithub()
|
||||
{
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
@ -37,16 +37,18 @@ Function Add-SqlsrvFromGithub()
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
$zipUrl = SqlsrvReleaseUrl
|
||||
if($zipUrl) {
|
||||
$nts = if (!$installed.ThreadSafe) { "nts" } else { "ts" }
|
||||
$noDotVersion = $version.replace('.', '')
|
||||
$extensionFilePath = "Windows-$version\$arch\php_${extension}_${noDotVersion}_${nts}.dll"
|
||||
Get-File -Url $zipUrl -OutFile $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip > $null 2>&1
|
||||
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\sqlsrv -Force > $null 2>&1
|
||||
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\sqlsrv\$extensionFilePath" -Destination "$ext_dir\php_$extension.dll"
|
||||
Enable-PhpExtension -Extension $extension -Path $php_dir
|
||||
}
|
||||
try {
|
||||
$zipUrl = SqlsrvReleaseUrl
|
||||
if($zipUrl) {
|
||||
$nts = if (!$installed.ThreadSafe) { "nts" } else { "ts" }
|
||||
$noDotVersion = $version.replace('.', '')
|
||||
$extensionFilePath = "Windows-$version\$arch\php_${extension}_${noDotVersion}_${nts}.dll"
|
||||
Get-File -Url $zipUrl -OutFile $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip > $null 2>&1
|
||||
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\sqlsrv -Force > $null 2>&1
|
||||
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\sqlsrv\$extensionFilePath" -Destination "$ext_dir\php_$extension.dll"
|
||||
Enable-PhpExtension -Extension $extension -Path $php_dir
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
# Function to add sqlsrv extension.
|
||||
@ -61,7 +63,12 @@ Function Add-Sqlsrv() {
|
||||
if (Test-Path $ext_dir\php_$extension.dll) {
|
||||
Enable-PhpExtension -Extension $extension -Path $php_dir
|
||||
} else {
|
||||
Add-SqlsrvFromGithub $extension >$null 2>&1
|
||||
try {
|
||||
Add-ExtensionFromGithub $extension > $null 2>&1
|
||||
} catch {}
|
||||
if (-not(Test-Extension $extension)) {
|
||||
Add-SqlsrvFromMSGithub $extension >$null 2>&1
|
||||
}
|
||||
if (-not(Test-Extension $extension)) {
|
||||
Add-Extension $extension >$null 2>&1
|
||||
}
|
||||
|
@ -71,10 +71,14 @@ Function Add-ZephirParser() {
|
||||
Enable-PhpExtension -Extension zephir_parser -Path $php_dir
|
||||
} else {
|
||||
$status = 'Installed and enabled'
|
||||
Add-ZephirParserFromGitHub $extension
|
||||
try {
|
||||
Add-ZephirParserFromGitHub $extension
|
||||
} catch {
|
||||
Add-Extension $extension >$null 2>&1
|
||||
}
|
||||
}
|
||||
Add-ExtensionLog zephir_parser $status
|
||||
} catch {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)"
|
||||
}
|
||||
}
|
||||
}
|
@ -17,9 +17,13 @@ add_zephir_parser_helper() {
|
||||
[ "$(uname -s)" = "Linux" ] && os_suffix=ubuntu || os_suffix=macos
|
||||
build_name=$(get -s -n "" https://api.github.com/repos/"$repo"/releases/tags/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1)
|
||||
[ -z "$build_name" ] && build_name=$(get -s -n "" "$zp_releases"/expanded_assets/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1)
|
||||
get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name"
|
||||
sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}"
|
||||
enable_extension zephir_parser extension
|
||||
if [ -n "$build_name" ]; then
|
||||
get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name"
|
||||
sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}"
|
||||
enable_extension zephir_parser extension
|
||||
else
|
||||
pecl_install zephir_parser
|
||||
fi
|
||||
}
|
||||
|
||||
# Add zephir_parser
|
||||
|
@ -6,6 +6,14 @@ add_sudo() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to link apt-fast to apt-get
|
||||
link_apt_fast() {
|
||||
if ! command -v apt-fast >/dev/null; then
|
||||
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
||||
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to setup environment for self-hosted runners.
|
||||
self_hosted_helper() {
|
||||
if ! command -v apt-fast >/dev/null; then
|
||||
@ -23,6 +31,10 @@ fix_broken_packages() {
|
||||
# Function to install a package
|
||||
install_packages() {
|
||||
packages=("$@")
|
||||
if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then
|
||||
echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1
|
||||
trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit
|
||||
fi
|
||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
||||
}
|
||||
|
||||
@ -99,8 +111,8 @@ add_devtools() {
|
||||
add_log "${tick:?}" "$tool" "Added $tool $semver"
|
||||
}
|
||||
|
||||
# Function to setup the nightly build from shivammathur/php-builder
|
||||
setup_nightly() {
|
||||
# Function to setup PHP from the shivammathur/php-builder builds.
|
||||
setup_php_builder() {
|
||||
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
|
||||
}
|
||||
|
||||
@ -174,8 +186,8 @@ update_php() {
|
||||
# Function to install PHP.
|
||||
add_php() {
|
||||
if [ "${runner:?}" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
||||
if [[ "$version" =~ ${nightly_versions:?} ]]; then
|
||||
setup_nightly
|
||||
if [[ "$version" =~ ${nightly_versions:?} || "$ts" = "zts" ]]; then
|
||||
setup_php_builder
|
||||
else
|
||||
add_packaged_php
|
||||
switch_version >/dev/null 2>&1
|
||||
@ -234,6 +246,7 @@ setup_php() {
|
||||
step_log "Setup PHP"
|
||||
sudo mkdir -m 777 -p /var/run /run/php
|
||||
php_config="$(command -v php-config)"
|
||||
check_pre_installed
|
||||
if [[ -z "$php_config" ]] || [ "$(php_semver | cut -c 1-3)" != "$version" ]; then
|
||||
if [ ! -e "/usr/bin/php$version" ] || [ ! -e "/usr/bin/php-config$version" ]; then
|
||||
add_php >/dev/null 2>&1
|
||||
@ -277,7 +290,7 @@ setup_php() {
|
||||
}
|
||||
|
||||
# Variables
|
||||
version=${1:-'8.3'}
|
||||
version=${1:-'8.4'}
|
||||
ini=${2:-'production'}
|
||||
src=${0%/*}/..
|
||||
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||
@ -285,6 +298,7 @@ apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends"
|
||||
scripts="$src"/scripts
|
||||
|
||||
add_sudo >/dev/null 2>&1
|
||||
link_apt_fast >/dev/null 2>&1
|
||||
|
||||
. /etc/os-release
|
||||
# shellcheck source=.
|
||||
|
@ -70,7 +70,6 @@ configure_brew() {
|
||||
core_repo="$tap_dir"/homebrew/homebrew-core
|
||||
|
||||
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
||||
export HOMEBREW_DEVELOPER=1
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
|
@ -54,8 +54,8 @@ update_lists() {
|
||||
status_file=/tmp/os_lists
|
||||
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
|
||||
list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
|
||||
status_file=/tmp/"${ppa/\//_}"
|
||||
elif [ -e "$list_file" ] && grep -Eq '^deb ' "$list_file"; then
|
||||
status_file=/tmp/"$(echo -n "$ppa_search" | shasum -a 256 | cut -d ' ' -f 1)"
|
||||
elif [ -e "$list_file" ] && grep -Eq '^deb |^Types deb' "$list_file"; then
|
||||
list="$list_file"
|
||||
fi
|
||||
if [ ! -e "$status_file" ]; then
|
||||
@ -88,7 +88,7 @@ add_key() {
|
||||
key_source=$4
|
||||
key_file=$5
|
||||
key_urls=("$key_source")
|
||||
if [[ "$key_source" =~ launchpad.net|debian.org|setup-php.com ]]; then
|
||||
if [[ "$key_source" =~ launchpad.net|debian.org ]]; then
|
||||
fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist")"
|
||||
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
|
||||
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
|
||||
@ -121,7 +121,7 @@ add_list() {
|
||||
key_source=${3:-"$ppa_url"}
|
||||
package_dist=${4:-"$VERSION_CODENAME"}
|
||||
branches=${5:-main}
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches"
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches$"
|
||||
if check_lists "$ppa" "$ppa_search"; then
|
||||
echo "Repository $ppa already exists";
|
||||
return 1;
|
||||
@ -142,7 +142,7 @@ check_ppa() {
|
||||
ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
|
||||
package_dist=${3:-"$VERSION_CODENAME"}
|
||||
branches=${4:-main}
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches"
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches$"
|
||||
if check_lists "$ppa" "$ppa_search"; then
|
||||
return 0;
|
||||
else
|
||||
@ -153,18 +153,39 @@ check_ppa() {
|
||||
# Function to remove a PPA.
|
||||
remove_list() {
|
||||
ppa=${1-ondrej/php}
|
||||
ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
|
||||
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
|
||||
[ -n "$2" ] && ppa_urls=("$2") || ppa_urls=("$lp_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu")
|
||||
for ppa_url in "${ppa_urls[@]}"; do
|
||||
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
|
||||
done
|
||||
sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring || true
|
||||
}
|
||||
|
||||
# Function to check if ubuntu ppa is up
|
||||
is_ubuntu_ppa_up() {
|
||||
ppa=${1:-ondrej/php}
|
||||
curl -s --connect-timeout 5 --max-time 5 --head --fail "$lp_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
|
||||
}
|
||||
|
||||
# Function to add the PPA mirror.
|
||||
add_ppa_sp_mirror() {
|
||||
ppa=$1
|
||||
ppa_name="$(basename "$ppa")"
|
||||
remove_list "$ppa" || true
|
||||
[ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$sp/$ppa/ubuntu" "$sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug"
|
||||
add_list sp/"$ppa_name" "$sp/$ppa/ubuntu" "$sp/$ppa/ubuntu/key.gpg"
|
||||
}
|
||||
|
||||
# Function to add a PPA.
|
||||
add_ppa() {
|
||||
set_base_version
|
||||
ppa=${1:-ondrej/php}
|
||||
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lp_ppa/$ppa/ubuntu" "$lp_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa"
|
||||
if is_ubuntu_ppa_up "$ppa" ; then
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lp_ppa/$ppa/ubuntu" "$lp_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa"
|
||||
else
|
||||
add_ppa_sp_mirror "$ppa"
|
||||
fi
|
||||
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
||||
@ -189,14 +210,17 @@ update_ppa() {
|
||||
}
|
||||
|
||||
# Variables
|
||||
list_file='/etc/apt/sources.list'
|
||||
list_dir="$list_file.d"
|
||||
list_dir='/etc/apt/sources.list.d'
|
||||
list_file="/etc/apt/sources.list.d/$ID.sources"
|
||||
[ -e "$list_file" ] || list_file='/etc/apt/sources.list'
|
||||
upstream_lsb='/etc/upstream-release/lsb-release'
|
||||
lp_api='https://api.launchpad.net/1.0'
|
||||
lp_ppa='http://ppa.launchpad.net'
|
||||
lpc_ppa='https://ppa.launchpadcontent.net'
|
||||
key_dir='/usr/share/keyrings'
|
||||
dist_info_dir='/usr/share/distro-info'
|
||||
sury='https://packages.sury.org'
|
||||
sp='https://setup-php.com'
|
||||
sks=(
|
||||
'https://keyserver.ubuntu.com'
|
||||
'https://pgp.mit.edu'
|
||||
|
@ -63,7 +63,12 @@ read_env() {
|
||||
|
||||
# Set Update to true if the ubuntu github image does not have PHP PPA.
|
||||
if [[ "$runner" = "github" && "${ImageOS}" =~ ubuntu.* ]]; then
|
||||
check_ppa ondrej/php || update=true
|
||||
if ! check_ppa ondrej/php; then
|
||||
update=true
|
||||
echo '' | sudo tee /tmp/sp_update >/dev/null 2>&1
|
||||
elif [ -e /tmp/sp_update ]; then
|
||||
update=true
|
||||
fi
|
||||
fi
|
||||
|
||||
export fail_fast
|
||||
@ -84,12 +89,23 @@ get() {
|
||||
if [ "$mode" = "-s" ]; then
|
||||
sudo curl "${curl_opts[@]}" "${links[0]}"
|
||||
else
|
||||
lock_path="$file_path.lock"
|
||||
until sudo mkdir "$lock_path" 2>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
if [ "$execute" = "-e" ]; then
|
||||
until [ -z "$(fuser "$file_path" 2>/dev/null)" ]; do
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
trap 'sudo rm -rf "$lock_path"' EXIT SIGINT SIGTERM
|
||||
for link in "${links[@]}"; do
|
||||
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
|
||||
[ "$status_code" = "200" ] && break
|
||||
done
|
||||
[ "$execute" = "-e" ] && sudo chmod a+x "$file_path"
|
||||
[ "$mode" = "-v" ] && echo "$status_code"
|
||||
sudo rm -rf "$lock_path" >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
|
||||
@ -168,6 +184,19 @@ self_hosted_setup() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to check pre-installed PHP
|
||||
check_pre_installed() {
|
||||
if [ "$version" = "pre" ]; then
|
||||
if [ -n "$php_config" ]; then
|
||||
version="$(php_semver | cut -c 1-3)"
|
||||
update=false
|
||||
else
|
||||
fail_fast=true
|
||||
add_log "$cross" "PHP" "No pre-installed PHP version found"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to configure PHP
|
||||
configure_php() {
|
||||
add_php_config
|
||||
|
@ -3,7 +3,7 @@ param (
|
||||
[ValidateNotNull()]
|
||||
[ValidateLength(1, [int]::MaxValue)]
|
||||
[string]
|
||||
$version = '8.2',
|
||||
$version = '8.4',
|
||||
[Parameter(Position = 1, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[ValidateLength(1, [int]::MaxValue)]
|
||||
@ -401,6 +401,15 @@ if (Test-Path -LiteralPath $php_dir -PathType Container) {
|
||||
}
|
||||
$status = "Installed"
|
||||
$extra_version = ""
|
||||
if($version -eq 'pre') {
|
||||
if($null -ne $installed) {
|
||||
$version = $installed.MajorMinorVersion
|
||||
$env:update = 'false'
|
||||
} else {
|
||||
Add-Log $cross "PHP" "No pre-installed PHP version found"
|
||||
Write-Error "No pre-installed PHP version found" -ErrorAction Stop
|
||||
}
|
||||
}
|
||||
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
|
||||
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
|
||||
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1
|
||||
@ -434,7 +443,7 @@ if($installed.MajorMinorVersion -ne $version) {
|
||||
Write-Error "Could not setup PHP $version" -ErrorAction Stop
|
||||
}
|
||||
if($version -lt "5.5") {
|
||||
('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Get-File -Url "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ >$null 2>&1 }
|
||||
('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Invoke-WebRequest -Uri "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ >$null 2>&1 }
|
||||
} else {
|
||||
$enable_extensions += ('opcache')
|
||||
}
|
||||
|
11
src/utils.ts
11
src/utils.ts
@ -436,12 +436,17 @@ export async function readPHPVersion(): Promise<string> {
|
||||
const versionFile =
|
||||
(await getInput('php-version-file', false)) || '.php-version';
|
||||
if (fs.existsSync(versionFile)) {
|
||||
return fs.readFileSync(versionFile, 'utf8').replace(/[\r\n]/g, '');
|
||||
const contents: string = fs.readFileSync(versionFile, 'utf8');
|
||||
const match: RegExpMatchArray | null = contents.match(
|
||||
/^(?:php\s)?(\d+\.\d+\.\d+)$/m
|
||||
);
|
||||
return match ? match[1] : contents.trim();
|
||||
} else if (versionFile !== '.php-version') {
|
||||
throw new Error(`Could not find '${versionFile}' file.`);
|
||||
}
|
||||
|
||||
const composerLock = 'composer.lock';
|
||||
const composerProjectDir = await readEnv('COMPOSER_PROJECT_DIR');
|
||||
const composerLock = path.join(composerProjectDir, 'composer.lock');
|
||||
if (fs.existsSync(composerLock)) {
|
||||
const lockFileContents = JSON.parse(fs.readFileSync(composerLock, 'utf8'));
|
||||
if (
|
||||
@ -452,7 +457,7 @@ export async function readPHPVersion(): Promise<string> {
|
||||
}
|
||||
}
|
||||
|
||||
const composerJson = 'composer.json';
|
||||
const composerJson = path.join(composerProjectDir, 'composer.json');
|
||||
if (fs.existsSync(composerJson)) {
|
||||
const composerFileContents = JSON.parse(
|
||||
fs.readFileSync(composerJson, 'utf8')
|
||||
|
Reference in New Issue
Block a user