Merge pull request #347 from shivammathur/develop

2.9.0
This commit is contained in:
Shivam Mathur 2020-11-27 01:12:30 +05:30
commit c0c6e403b6
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
19 changed files with 372 additions and 355 deletions

203
README.md
View File

@ -37,13 +37,14 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
- [Flags](#flags) - [Flags](#flags)
- [Basic Setup](#basic-setup) - [Basic Setup](#basic-setup)
- [Matrix Setup](#matrix-setup) - [Matrix Setup](#matrix-setup)
- [Multi-Arch Setup](#multi-arch-setup)
- [Nightly Build Setup](#nightly-build-setup) - [Nightly Build Setup](#nightly-build-setup)
- [Thread Safe Setup](#thread-safe-setup)
- [Force Update Setup](#force-update-setup)
- [Verbose Setup](#verbose-setup)
- [Multi-Arch Setup](#multi-arch-setup)
- [Self Hosted Setup](#self-hosted-setup) - [Self Hosted Setup](#self-hosted-setup)
- [Local Testing Setup](#local-testing-setup) - [Local Testing Setup](#local-testing-setup)
- [Thread Safe Setup](#thread-safe-setup) - [JIT Configuration](#jit-configuration)
- [Force Update](#force-update)
- [Verbose Setup](#verbose-setup)
- [Cache Extensions](#cache-extensions) - [Cache Extensions](#cache-extensions)
- [Cache Composer Dependencies](#cache-composer-dependencies) - [Cache Composer Dependencies](#cache-composer-dependencies)
- [Cache Node.js Dependencies](#cache-nodejs-dependencies) - [Cache Node.js Dependencies](#cache-nodejs-dependencies)
@ -67,14 +68,15 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|`5.6`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`| |`5.6`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.0`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`| |`7.0`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.1`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`| |`7.1`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.2`|`Stable`|`Security fixes only`|`GitHub-hosted`, `self-hosted`| |`7.2`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|`7.3`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`| |`7.3`|`Stable`|`Security fixes only`|`GitHub-hosted`, `self-hosted`|
|`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`| |`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|`8.0`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`| |`8.0`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|`8.1`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`| |`8.1`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
**Note:** Specifying `8.0` and `8.1` in `php-version` input installs a nightly build of `PHP 8.0.0-dev` and `PHP 8.1.0-dev` respectively. See [nightly build setup](#nightly-build-setup) for more information. **Notes:**
- Specifying `8.1` in `php-version` input installs a nightly build of `PHP 8.1.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
- To use JIT on `PHP 8.0` and `PHP 8.1` refer to the [JIT configuration](#jit-configuration) section.
## :cloud: OS/Platform Support ## :cloud: OS/Platform Support
@ -107,7 +109,7 @@ The action supports both `GitHub-hosted` runners and `self-hosted` runners on th
## :heavy_plus_sign: PHP Extension Support ## :heavy_plus_sign: PHP Extension Support
- Extensions enabled by default after `setup-php` runs can be found on the [wiki](https://github.com/shivammathur/setup-php/wiki). - Extensions loaded by default after `setup-php` runs can be found on the [wiki](https://github.com/shivammathur/setup-php/wiki).
- On `ubuntu` by default extensions which are available as a package can be installed. PECL extensions if not available as a package can be installed by specifying `pecl` in the tools input. - On `ubuntu` by default extensions which are available as a package can be installed. PECL extensions if not available as a package can be installed by specifying `pecl` in the tools input.
@ -206,7 +208,7 @@ These tools can be setup globally using the `tools` input.
tools: composer:v2 tools: composer:v2
``` ```
- If you have specified composer plugins `prestissimo` or `composer-prefetcher` in tools, the latest stable version of `composer v1` will be setup. Unless some of your packages require `composer v1`, it is recommended to drop `prestissimo` and use `composer v2`. - Tools `prestissimo` and `composer-prefetcher` will be skipped unless `composer:v1` is also specified in tools input. It is recommended to drop `prestissimo` and use `composer v2`.
- The latest versions of both agent `blackfire-agent` and client `blackfire` are setup when `blackfire` is specified in tools input. Please refer to the [official documentation](https://blackfire.io/docs/integrations/ci/github-actions "Blackfire.io documentation for GitHub Actions") for using `blackfire` with GitHub Actions. - The latest versions of both agent `blackfire-agent` and client `blackfire` are setup when `blackfire` is specified in tools input. Please refer to the [official documentation](https://blackfire.io/docs/integrations/ci/github-actions "Blackfire.io documentation for GitHub Actions") for using `blackfire` with GitHub Actions.
@ -269,7 +271,7 @@ If your source code directory is other than `src`, `lib` or, `app`, specify `pco
``` ```
`PHPUnit` 8 and above supports `PCOV` out of the box. `PHPUnit` 8 and above supports `PCOV` out of the box.
If you are using `PHPUnit` 5, 6 or 7, you will need `krakjoe/pcov-clobber`. If you are using `PHPUnit` 5, 6 or 7, you will need `pcov/clobber`.
Before executing your tests add the following step. Before executing your tests add the following step.
```yaml ```yaml
@ -320,7 +322,7 @@ Consider disabling the coverage using this PHP action for these reasons.
#### `ini-values` (optional) #### `ini-values` (optional)
- Specify the values you want to add to `php.ini`. - Specify the values you want to add to `php.ini`.
- Accepts a `string` in csv-format. For example `post_max_size=256M, short_open_tag=On`. - Accepts a `string` in csv-format. For example `post_max_size=256M, max_execution_time=180`.
#### `coverage` (optional) #### `coverage` (optional)
@ -357,7 +359,7 @@ Consider disabling the coverage using this PHP action for these reasons.
- Specify to update PHP on the runner to the latest patch version. - Specify to update PHP on the runner to the latest patch version.
- Accepts `true` and `false`. - Accepts `true` and `false`.
- By default, it is set to `false`. - By default, it is set to `false`.
- See [force update](#force-update) for more info. - See [force update setup](#force-update-setup) for more info.
See below for more info. See below for more info.
@ -375,7 +377,7 @@ steps:
with: with:
php-version: '7.4' php-version: '7.4'
extensions: mbstring, intl extensions: mbstring, intl
ini-values: post_max_size=256M, short_open_tag=On ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug coverage: xdebug
tools: php-cs-fixer, phpunit tools: php-cs-fixer, phpunit
``` ```
@ -402,11 +404,88 @@ jobs:
with: with:
php-version: ${{ matrix.php-versions }} php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl extensions: mbstring, intl
ini-values: post_max_size=256M, short_open_tag=On ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug coverage: xdebug
tools: php-cs-fixer, phpunit tools: php-cs-fixer, phpunit
``` ```
### Nightly Build Setup
> Setup a nightly build of `PHP 8.1`.
- This version is currently in development.
- `PECL` is installed by default with `PHP 8.1` on both `ubuntu` and `macOS`.
- Some user space extensions might not support this version currently.
```yaml
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup nightly PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit
```
### Thread Safe Setup
> Setup `TS` or `NTS` PHP on `Windows`.
- `NTS` versions are setup by default.
- On `Ubuntu` and `macOS` only `NTS` versions are supported.
- On `Windows` both `TS` and `NTS` versions are supported.
```yaml
jobs:
run:
runs-on: windows-latest
name: Setup PHP TS on Windows
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
env:
phpts: ts # specify ts or nts
```
### Force Update Setup
> Update to the latest patch of PHP versions.
- Pre-installed PHP versions on the GitHub Actions runner are not updated to their latest patch release by default.
- You can specify the `update` environment variable to `true` to force update to the latest release.
```yaml
- name: Setup PHP with latest versions
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
env:
update: true # specify true or false
```
### Verbose Setup
> Debug your workflow
To debug any issues, you can use the `verbose` tag instead of `v2`.
```yaml
- name: Setup PHP with logs
uses: shivammathur/setup-php@verbose
with:
php-version: '7.4'
```
### Multi-Arch Setup ### Multi-Arch Setup
> Setup PHP on multiple architecture on Ubuntu GitHub Runners. > Setup PHP on multiple architecture on Ubuntu GitHub Runners.
@ -433,36 +512,11 @@ jobs:
# Install PHP # Install PHP
spc --php-version "7.4" \ spc --php-version "7.4" \
--extensions "mbstring, intl" \ --extensions "mbstring, intl" \
--ini-values "post_max_size=256M, short_open_tag=On" \ --ini-values "post_max_size=256M, max_execution_time=180" \
--coverage "xdebug" \ --coverage "xdebug" \
--tools "php-cs-fixer, phpunit" --tools "php-cs-fixer, phpunit"
``` ```
### Nightly Build Setup
> Setup a nightly build of `PHP 8.0` or `PHP 8.1`.
- These versions are currently in development.
- `PECL` is installed by default with these versions on `ubuntu` and `macOS`.
- Some user space extensions might not support these versions currently.
- Refer to this [RFC](https://wiki.php.net/rfc/jit "PHP JIT RFC configuration") for configuring `PHP JIT` on these versions.
- Refer to this [list of RFCs](https://wiki.php.net/rfc#php_80 "List of RFCs implemented in PHP8") for features implemented in `PHP 8.0`.
```yaml
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup nightly PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring
ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1
coverage: pcov
tools: php-cs-fixer, phpunit
```
### Self Hosted Setup ### Self Hosted Setup
> Setup PHP on a self-hosted runner. > Setup PHP on a self-hosted runner.
@ -533,58 +587,22 @@ act -P ubuntu-18.04=shivammathur/node:bionic
act -P ubuntu-16.04=shivammathur/node:xenial act -P ubuntu-16.04=shivammathur/node:xenial
``` ```
### Thread Safe Setup ### JIT Configuration
> Setup `TS` or `NTS` PHP on `Windows`. > Enable Just-in-time(JIT) on PHP 8.0 and PHP 8.1.
- `NTS` versions are setup by default. - To enable JIT, enable `opcache` in cli mode by setting `opcache.enable_cli=1`.
- On `Ubuntu` and `macOS` only `NTS` versions are supported. - By default, `opcache.jit=1235` and `opcache.jit_buffer_size=256M` are set which can be changed using `ini-values` input.
- On `Windows` both `TS` and `NTS` versions are supported. - For detailed information about JIT related directives refer to the [`official PHP documentation`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit "opcache.jit documentation").
For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
```yaml ```yaml
jobs: - name: Setup PHP with JIT in tracing mode
run:
runs-on: windows-latest
name: Setup PHP TS on Windows
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
env:
phpts: ts # specify ts or nts
```
### Force Update
> Update to the latest patch of PHP versions.
- Pre-installed PHP versions on the GitHub Actions runner are not updated to their latest patch release by default.
- You can specify the `update` environment variable to `true` to force update to the latest release.
```yaml
- name: Setup PHP with latest versions
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '7.4' php-version: '8.0'
env: ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M
update: true # specify true or false
```
### Verbose Setup
> Debug your workflow
To debug any issues, you can use the `verbose` tag instead of `v2`.
```yaml
- name: Setup PHP with logs
uses: shivammathur/setup-php@verbose
with:
php-version: '7.4'
``` ```
### Cache Extensions ### Cache Extensions
@ -776,7 +794,7 @@ Examples of using `setup-php` with various PHP Frameworks and Packages.
> Contributions are welcome! > Contributions are welcome!
- See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/setup-php contribution guide") before you start. - See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/setup-php contribution guide") before you start.
- If you face any issues while using this or want to suggest a feature/improvement, create an issue [here](https://github.com/shivammathur/setup-php/issues "Issues reported"). - If you face any issues or want to suggest a feature/improvement, start a discussion [here](https://github.com/shivammathur/setup-php/discussions "Setup PHP discussions").
*Join the list of setup-php contributors* *Join the list of setup-php contributors*
@ -788,9 +806,12 @@ Examples of using `setup-php` with various PHP Frameworks and Packages.
## :sparkling_heart: Support This Project ## :sparkling_heart: Support This Project
- If setup-php saved your developer time, please consider sponsoring setup-php:
- [Open Collective](https://opencollective.com/setup-php "setup-php Open Collective")
- [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal")
- [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon")
- Please [reach out](mailto:contact@setup-php.com) if you have any questions regarding sponsoring setup-php.
- Please star the project and share it. If you blog, please share your experience of using this action. - Please star the project and share it. If you blog, please share your experience of using this action.
- Please consider supporting our work by sponsoring using [Open Collective](https://opencollective.com/setup-php), [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal") or [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon").
- If you use `setup-php` at your company, please [reach out](mailto:contact@setup-php.com) to sponsor the project.
*Huge thanks to the following companies for supporting `setup-php`* *Huge thanks to the following companies for supporting `setup-php`*

View File

@ -28,11 +28,13 @@ describe('Config tests', () => {
it('checking addCoverage with Xdebug on windows', async () => { it('checking addCoverage with Xdebug on windows', async () => {
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32'); const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
expect(win32).toContain('Add-Extension xdebug'); expect(win32).toContain('Add-Extension xdebug');
expect(win32).toContain('xdebug.mode=coverage');
}); });
it('checking addCoverage with Xdebug on linux', async () => { it('checking addCoverage with Xdebug on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux'); const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
expect(linux).toContain('add_extension xdebug'); expect(linux).toContain('add_extension xdebug');
expect(linux).toContain('echo "xdebug.mode=coverage"');
}); });
it('checking addCoverage with Xdebug3 on linux', async () => { it('checking addCoverage with Xdebug3 on linux', async () => {

View File

@ -25,6 +25,9 @@ describe('Extension tests', () => {
'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"' 'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
); );
win32 = await extensions.addExtension('xdebug', '7.2', 'win32');
expect(win32).toContain('Add-Extension xdebug stable 2.9.8');
win32 = await extensions.addExtension('mysql', '7.4', 'win32'); win32 = await extensions.addExtension('mysql', '7.4', 'win32');
expect(win32).toContain('Add-Extension mysqli'); expect(win32).toContain('Add-Extension mysqli');
expect(win32).toContain('Add-Extension mysqlnd'); expect(win32).toContain('Add-Extension mysqlnd');
@ -96,6 +99,9 @@ describe('Extension tests', () => {
linux = await extensions.addExtension('cubrid', '7.4', 'linux'); linux = await extensions.addExtension('cubrid', '7.4', 'linux');
expect(linux).toContain('add_cubrid cubrid'); expect(linux).toContain('add_cubrid cubrid');
linux = await extensions.addExtension('xdebug', '7.2', 'linux');
expect(linux).toContain('add_pecl_extension xdebug 2.9.8 zend_extension');
linux = await extensions.addExtension('xdebug', '7.2', 'openbsd'); linux = await extensions.addExtension('xdebug', '7.2', 'openbsd');
expect(linux).toContain('Platform openbsd is not supported'); expect(linux).toContain('Platform openbsd is not supported');

View File

@ -117,7 +117,7 @@ describe('Install', () => {
script = '' + (await install.run()); script = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('bash linux.sh 7.4 '); expect(script).toContain('bash linux.sh 8.0 ');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit'); setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit');

View File

@ -251,9 +251,6 @@ describe('Tools tests', () => {
expect( expect(
await tools.addComposer(['a', 'b', 'c', 'composer:v2']) await tools.addComposer(['a', 'b', 'c', 'composer:v2'])
).toStrictEqual(['composer:2', 'a', 'b', 'c']); ).toStrictEqual(['composer:2', 'a', 'b', 'c']);
expect(
await tools.addComposer(['hirak', 'b', 'c', 'composer:v2'])
).toStrictEqual(['composer:1', 'hirak', 'b', 'c']);
}); });
it('checking getComposerUrl', async () => { it('checking getComposerUrl', async () => {
@ -629,6 +626,7 @@ describe('Tools tests', () => {
}); });
it('checking addTools with composer tool using user/tool as input', async () => { it('checking addTools with composer tool using user/tool as input', async () => {
const listOfTools = [ const listOfTools = [
'composer:v1',
'hirak/prestissimo', 'hirak/prestissimo',
'narrowspark/automatic-composer-prefetcher', 'narrowspark/automatic-composer-prefetcher',
'robmorgan/phinx' 'robmorgan/phinx'

View File

@ -36,17 +36,18 @@ describe('Utils tests', () => {
it('checking parseVersion', async () => { it('checking parseVersion', async () => {
expect(await utils.parseVersion('7')).toBe('7.0'); expect(await utils.parseVersion('7')).toBe('7.0');
expect(await utils.parseVersion('7.4')).toBe('7.4'); expect(await utils.parseVersion('7.4')).toBe('7.4');
expect(await utils.parseVersion('latest')).toBe('7.4'); expect(await utils.parseVersion('latest')).toBe('8.0');
}); });
it('checking asyncForEach', async () => { it('checking asyncForEach', async () => {
const array: Array<string> = ['a', 'b', 'c']; const array: Array<string> = ['a', 'b', 'c'];
let concat = ''; let concat = '';
await utils.asyncForEach(array, async function ( await utils.asyncForEach(
str: string array,
): Promise<void> { async function (str: string): Promise<void> {
concat += str; concat += str;
}); }
);
expect(concat).toBe('abc'); expect(concat).toBe('abc');
}); });
@ -83,12 +84,12 @@ describe('Utils tests', () => {
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || ''; const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
const script_path: string = path.join(runner_dir, 'test.sh'); const script_path: string = path.join(runner_dir, 'test.sh');
await utils.writeScript('test.sh', testString); await utils.writeScript('test.sh', testString);
await fs.readFile(script_path, function ( await fs.readFile(
error: Error | null, script_path,
data: Buffer function (error: Error | null, data: Buffer) {
) { expect(testString).toBe(data.toString());
expect(testString).toBe(data.toString()); }
}); );
await cleanup(script_path); await cleanup(script_path);
}); });

View File

@ -1,13 +1,13 @@
name: 'Setup PHP Action' name: 'Setup PHP Action'
author: shivammathur author: shivammathur
description: 'Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer' description: 'GitHub Action for PHP'
branding: branding:
color: 'purple' color: 'purple'
icon: 'play-circle' icon: 'play-circle'
inputs: inputs:
php-version: php-version:
description: 'Setup PHP version.' description: 'Setup PHP version.'
default: '7.4' default: '8.0'
required: true required: true
extensions: extensions:
description: 'Setup PHP extensions.' description: 'Setup PHP extensions.'

30
dist/index.js vendored
View File

@ -1102,7 +1102,7 @@ exports.getInput = getInput;
async function parseVersion(version) { async function parseVersion(version) {
switch (version) { switch (version) {
case 'latest': case 'latest':
return '7.4'; return '8.0';
default: default:
switch (true) { switch (true) {
case version.length > 1: case version.length > 1:
@ -2023,14 +2023,10 @@ exports.getWpCliUrl = getWpCliUrl;
async function addComposer(tools_list) { async function addComposer(tools_list) {
const regex_any = /^composer($|:.*)/; const regex_any = /^composer($|:.*)/;
const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$|v?\d+\.\d+\.\d+[\w-]*$)/; const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$|v?\d+\.\d+\.\d+[\w-]*$)/;
const regex_composer1_tools = /hirak|prestissimo|narrowspark|composer-prefetcher/;
const matches = tools_list.filter(tool => regex_valid.test(tool)); const matches = tools_list.filter(tool => regex_valid.test(tool));
let composer = 'composer'; let composer = 'composer';
tools_list = tools_list.filter(tool => !regex_any.test(tool)); tools_list = tools_list.filter(tool => !regex_any.test(tool));
switch (true) { switch (true) {
case regex_composer1_tools.test(tools_list.join(' ')):
composer = 'composer:1';
break;
case matches[0] == undefined: case matches[0] == undefined:
break; break;
default: default:
@ -2332,14 +2328,7 @@ async function addCoverageXdebug(extension, version, os_version, pipe) {
pipe; pipe;
const ini = await config.addINIValues('xdebug.mode=coverage', os_version, true); const ini = await config.addINIValues('xdebug.mode=coverage', os_version, true);
const log = await utils.addLog('$tick', extension, 'Xdebug enabled as coverage driver', os_version); const log = await utils.addLog('$tick', extension, 'Xdebug enabled as coverage driver', os_version);
switch (true) { return [xdebug, ini, log].join('\n');
case /^xdebug3$/.test(extension):
case /^8\.\d$/.test(version):
return '\n' + xdebug + '\n' + ini + '\n' + log;
case /^xdebug$/.test(extension):
default:
return xdebug + '\n' + log;
}
} }
exports.addCoverageXdebug = addCoverageXdebug; exports.addCoverageXdebug = addCoverageXdebug;
/** /**
@ -2893,7 +2882,7 @@ async function addExtensionDarwin(extension_csv, version) {
add_script += await utils.customPackage(ext_name, 'ext', extension, 'darwin'); add_script += await utils.customPackage(ext_name, 'ext', extension, 'darwin');
return; return;
// match pre-release versions. For example - xdebug-beta // match pre-release versions. For example - xdebug-beta
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(version_extension):
add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix); add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix);
return; return;
// match semver // match semver
@ -2959,8 +2948,8 @@ async function addExtensionWindows(extension_csv, version) {
add_script += await utils.customPackage(ext_name, 'ext', extension, 'win32'); add_script += await utils.customPackage(ext_name, 'ext', extension, 'win32');
return; return;
// match pre-release versions. For example - xdebug-beta // match pre-release versions. For example - xdebug-beta
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.*-(stable|beta|alpha|devel|snapshot)/.test(version_extension):
add_script += await utils.joins('\nAdd-Extension', ext_name, ext_version); add_script += await utils.joins('\nAdd-Extension', ext_name, ext_version.replace('stable', ''));
break; break;
// match semver without state // match semver without state
case /.*-\d+\.\d+\.\d+$/.test(version_extension): case /.*-\d+\.\d+\.\d+$/.test(version_extension):
@ -2972,6 +2961,9 @@ async function addExtensionWindows(extension_csv, version) {
add_script += await utils.joins('\nAdd-Extension', ext_name, matches[2].replace('preview', 'devel'), matches[1]); add_script += await utils.joins('\nAdd-Extension', ext_name, matches[2].replace('preview', 'devel'), matches[1]);
break; break;
// match 5.3pcov to 7.0pcov // match 5.3pcov to 7.0pcov
case /7\.2xdebug/.test(version_extension):
add_script += '\nAdd-Extension xdebug stable 2.9.8';
break;
case /(5\.[3-6]|7\.0)pcov/.test(version_extension): case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
add_script += await utils.getUnsupportedLog('pcov', version, 'win32'); add_script += await utils.getUnsupportedLog('pcov', version, 'win32');
break; break;
@ -3037,7 +3029,7 @@ async function addExtensionLinux(extension_csv, version) {
add_script += await utils.customPackage(ext_name, 'ext', extension, 'linux'); add_script += await utils.customPackage(ext_name, 'ext', extension, 'linux');
return; return;
// match pre-release versions. For example - xdebug-beta // match pre-release versions. For example - xdebug-beta
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(version_extension):
add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix); add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix);
return; return;
// match semver versions // match semver versions
@ -3053,6 +3045,10 @@ async function addExtensionLinux(extension_csv, version) {
add_script += add_script +=
'\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension'; '\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension';
return; return;
// match 7.2xdebug
case /^7\.2xdebug$/.test(version_extension):
add_script += await utils.joins('\nadd_pecl_extension', ext_name, '2.9.8', ext_prefix);
break;
// match 8.0xdebug3...8.9xdebug3 // match 8.0xdebug3...8.9xdebug3
case /^8\.[0-9]xdebug3$/.test(version_extension): case /^8\.[0-9]xdebug3$/.test(version_extension):
extension = 'xdebug'; extension = 'xdebug';

301
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.8.0", "version": "2.9.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -32,19 +32,19 @@
} }
}, },
"@babel/core": { "@babel/core": {
"version": "7.12.3", "version": "7.12.9",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz",
"integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==", "integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.10.4", "@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1", "@babel/generator": "^7.12.5",
"@babel/helper-module-transforms": "^7.12.1", "@babel/helper-module-transforms": "^7.12.1",
"@babel/helpers": "^7.12.1", "@babel/helpers": "^7.12.5",
"@babel/parser": "^7.12.3", "@babel/parser": "^7.12.7",
"@babel/template": "^7.10.4", "@babel/template": "^7.12.7",
"@babel/traverse": "^7.12.1", "@babel/traverse": "^7.12.9",
"@babel/types": "^7.12.1", "@babel/types": "^7.12.7",
"convert-source-map": "^1.7.0", "convert-source-map": "^1.7.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.1", "gensync": "^1.0.0-beta.1",
@ -118,12 +118,12 @@
} }
}, },
"@babel/helper-member-expression-to-functions": { "@babel/helper-member-expression-to-functions": {
"version": "7.12.1", "version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz",
"integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==", "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/types": "^7.12.1" "@babel/types": "^7.12.7"
} }
}, },
"@babel/helper-module-imports": { "@babel/helper-module-imports": {
@ -153,12 +153,12 @@
} }
}, },
"@babel/helper-optimise-call-expression": { "@babel/helper-optimise-call-expression": {
"version": "7.10.4", "version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.7.tgz",
"integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "integrity": "sha512-I5xc9oSJ2h59OwyUqjv95HRyzxj53DAubUERgQMrpcCEYQyToeHA+NEcUEsVWB4j53RDeskeBJ0SgRAYHDBckw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/types": "^7.10.4" "@babel/types": "^7.12.7"
} }
}, },
"@babel/helper-plugin-utils": { "@babel/helper-plugin-utils": {
@ -278,9 +278,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.12.5", "version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
"integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
"dev": true "dev": true
}, },
"@babel/plugin-syntax-async-generators": { "@babel/plugin-syntax-async-generators": {
@ -392,28 +392,28 @@
} }
}, },
"@babel/template": { "@babel/template": {
"version": "7.10.4", "version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz",
"integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.10.4", "@babel/code-frame": "^7.10.4",
"@babel/parser": "^7.10.4", "@babel/parser": "^7.12.7",
"@babel/types": "^7.10.4" "@babel/types": "^7.12.7"
} }
}, },
"@babel/traverse": { "@babel/traverse": {
"version": "7.12.5", "version": "7.12.9",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz",
"integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", "integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.10.4", "@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.5", "@babel/generator": "^7.12.5",
"@babel/helper-function-name": "^7.10.4", "@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0", "@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.5", "@babel/parser": "^7.12.7",
"@babel/types": "^7.12.5", "@babel/types": "^7.12.7",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0", "globals": "^11.1.0",
"lodash": "^4.17.19" "lodash": "^4.17.19"
@ -428,9 +428,9 @@
} }
}, },
"@babel/types": { "@babel/types": {
"version": "7.12.6", "version": "7.12.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
"integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.10.4", "@babel/helper-validator-identifier": "^7.10.4",
@ -836,9 +836,9 @@
} }
}, },
"@types/babel__traverse": { "@types/babel__traverse": {
"version": "7.0.15", "version": "7.0.16",
"resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.15.tgz", "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.16.tgz",
"integrity": "sha512-Pzh9O3sTK8V6I1olsXpCfj2k/ygO2q1X0vhhnDrEQyYLHZesWz+zMZMVcwXLCYf0U36EtmyYaFGPfXlTtDHe3A==", "integrity": "sha512-S63Dt4CZOkuTmpLGGWtT/mQdVORJOpx6SZWGVaP56dda/0Nx5nEe82K7/LAm8zYr6SfMq+1N2OreIOrHAx656w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/types": "^7.3.0" "@babel/types": "^7.3.0"
@ -900,9 +900,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "14.14.7", "version": "14.14.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.10.tgz",
"integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==", "integrity": "sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ==",
"dev": true "dev": true
}, },
"@types/normalize-package-data": { "@types/normalize-package-data": {
@ -930,9 +930,9 @@
"dev": true "dev": true
}, },
"@types/yargs": { "@types/yargs": {
"version": "15.0.9", "version": "15.0.10",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.10.tgz",
"integrity": "sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==", "integrity": "sha512-z8PNtlhrj7eJNLmrAivM7rjBESG6JwC5xP3RVk12i/8HVP7Xnx/sEmERnRImyEuUaJfO942X0qMOYsoupaJbZQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/yargs-parser": "*" "@types/yargs-parser": "*"
@ -945,13 +945,13 @@
"dev": true "dev": true
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "4.7.0", "version": "4.8.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.8.2.tgz",
"integrity": "sha512-li9aiSVBBd7kU5VlQlT1AqP0uWGDK6JYKUQ9cVDnOg34VNnd9t4jr0Yqc/bKxJr/tDCPDaB4KzoSFN9fgVxe/Q==", "integrity": "sha512-gQ06QLV5l1DtvYtqOyFLXD9PdcILYqlrJj2l+CGDlPtmgLUzc1GpqciJFIRvyfvgLALpnxYINFuw+n9AZhPBKQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/experimental-utils": "4.7.0", "@typescript-eslint/experimental-utils": "4.8.2",
"@typescript-eslint/scope-manager": "4.7.0", "@typescript-eslint/scope-manager": "4.8.2",
"debug": "^4.1.1", "debug": "^4.1.1",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0", "regexpp": "^3.0.0",
@ -960,55 +960,55 @@
} }
}, },
"@typescript-eslint/experimental-utils": { "@typescript-eslint/experimental-utils": {
"version": "4.7.0", "version": "4.8.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.2.tgz",
"integrity": "sha512-cymzovXAiD4EF+YoHAB5Oh02MpnXjvyaOb+v+BdpY7lsJXZQN34oIETeUwVT2XfV9rSNpXaIcknDLfupO/tUoA==", "integrity": "sha512-hpTw6o6IhBZEsQsjuw/4RWmceRyESfAiEzAEnXHKG1X7S5DXFaZ4IO1JO7CW1aQ604leQBzjZmuMI9QBCAJX8Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/json-schema": "^7.0.3", "@types/json-schema": "^7.0.3",
"@typescript-eslint/scope-manager": "4.7.0", "@typescript-eslint/scope-manager": "4.8.2",
"@typescript-eslint/types": "4.7.0", "@typescript-eslint/types": "4.8.2",
"@typescript-eslint/typescript-estree": "4.7.0", "@typescript-eslint/typescript-estree": "4.8.2",
"eslint-scope": "^5.0.0", "eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0" "eslint-utils": "^2.0.0"
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "4.7.0", "version": "4.8.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.8.2.tgz",
"integrity": "sha512-+meGV8bMP1sJHBI2AFq1GeTwofcGiur8LoIr6v+rEmD9knyCqDlrQcFHR0KDDfldHIFDU/enZ53fla6ReF4wRw==", "integrity": "sha512-u0leyJqmclYr3KcXOqd2fmx6SDGBO0MUNHHAjr0JS4Crbb3C3d8dwAdlazy133PLCcPn+aOUFiHn72wcuc5wYw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/scope-manager": "4.7.0", "@typescript-eslint/scope-manager": "4.8.2",
"@typescript-eslint/types": "4.7.0", "@typescript-eslint/types": "4.8.2",
"@typescript-eslint/typescript-estree": "4.7.0", "@typescript-eslint/typescript-estree": "4.8.2",
"debug": "^4.1.1" "debug": "^4.1.1"
} }
}, },
"@typescript-eslint/scope-manager": { "@typescript-eslint/scope-manager": {
"version": "4.7.0", "version": "4.8.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.8.2.tgz",
"integrity": "sha512-ILITvqwDJYbcDCROj6+Ob0oCKNg3SH46iWcNcTIT9B5aiVssoTYkhKjxOMNzR1F7WSJkik4zmuqve5MdnA0DyA==", "integrity": "sha512-qHQ8ODi7mMin4Sq2eh/6eu03uVzsf5TX+J43xRmiq8ujng7ViQSHNPLOHGw/Wr5dFEoxq/ubKhzClIIdQy5q3g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.7.0", "@typescript-eslint/types": "4.8.2",
"@typescript-eslint/visitor-keys": "4.7.0" "@typescript-eslint/visitor-keys": "4.8.2"
} }
}, },
"@typescript-eslint/types": { "@typescript-eslint/types": {
"version": "4.7.0", "version": "4.8.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.8.2.tgz",
"integrity": "sha512-uLszFe0wExJc+I7q0Z/+BnP7wao/kzX0hB5vJn4LIgrfrMLgnB2UXoReV19lkJQS1a1mHWGGODSxnBx6JQC3Sg==", "integrity": "sha512-z1/AVcVF8ju5ObaHe2fOpZYEQrwHyZ7PTOlmjd3EoFeX9sv7UekQhfrCmgUO7PruLNfSHrJGQvrW3Q7xQ8EoAw==",
"dev": true "dev": true
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "4.7.0", "version": "4.8.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.8.2.tgz",
"integrity": "sha512-5XZRQznD1MfUmxu1t8/j2Af4OxbA7EFU2rbo0No7meb46eHgGkSieFdfV6omiC/DGIBhH9H9gXn7okBbVOm8jw==", "integrity": "sha512-HToGNwI6fekH0dOw3XEVESUm71Onfam0AKin6f26S2FtUmO7o3cLlWgrIaT1q3vjB3wCTdww3Dx2iGq5wtUOCg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.7.0", "@typescript-eslint/types": "4.8.2",
"@typescript-eslint/visitor-keys": "4.7.0", "@typescript-eslint/visitor-keys": "4.8.2",
"debug": "^4.1.1", "debug": "^4.1.1",
"globby": "^11.0.1", "globby": "^11.0.1",
"is-glob": "^4.0.1", "is-glob": "^4.0.1",
@ -1018,12 +1018,12 @@
} }
}, },
"@typescript-eslint/visitor-keys": { "@typescript-eslint/visitor-keys": {
"version": "4.7.0", "version": "4.8.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.8.2.tgz",
"integrity": "sha512-aDJDWuCRsf1lXOtignlfiPODkzSxxop7D0rZ91L6ZuMlcMCSh0YyK+gAfo5zN/ih6WxMwhoXgJWC3cWQdaKC+A==", "integrity": "sha512-Vg+/SJTMZJEKKGHW7YC21QxgKJrSbxoYYd3MEUGtW7zuytHuEcksewq0DUmo4eh/CTNrVJGSdIY9AtRb6riWFw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.7.0", "@typescript-eslint/types": "4.8.2",
"eslint-visitor-keys": "^2.0.0" "eslint-visitor-keys": "^2.0.0"
} }
}, },
@ -1155,13 +1155,15 @@
"dev": true "dev": true
}, },
"array-includes": { "array-includes": {
"version": "3.1.1", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz",
"integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", "integrity": "sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==",
"dev": true, "dev": true,
"requires": { "requires": {
"call-bind": "^1.0.0",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.0", "es-abstract": "^1.18.0-next.1",
"get-intrinsic": "^1.0.1",
"is-string": "^1.0.5" "is-string": "^1.0.5"
} }
}, },
@ -1178,13 +1180,14 @@
"dev": true "dev": true
}, },
"array.prototype.flat": { "array.prototype.flat": {
"version": "1.2.3", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz",
"integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==",
"dev": true, "dev": true,
"requires": { "requires": {
"call-bind": "^1.0.0",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.1" "es-abstract": "^1.18.0-next.1"
} }
}, },
"asn1": { "asn1": {
@ -1742,9 +1745,9 @@
} }
}, },
"debug": { "debug": {
"version": "4.2.0", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"ms": "2.1.2" "ms": "2.1.2"
@ -1939,9 +1942,9 @@
} }
}, },
"es-abstract": { "es-abstract": {
"version": "1.17.7", "version": "1.18.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
"integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"dev": true, "dev": true,
"requires": { "requires": {
"es-to-primitive": "^1.2.1", "es-to-primitive": "^1.2.1",
@ -1949,6 +1952,7 @@
"has": "^1.0.3", "has": "^1.0.3",
"has-symbols": "^1.0.1", "has-symbols": "^1.0.1",
"is-callable": "^1.2.2", "is-callable": "^1.2.2",
"is-negative-zero": "^2.0.0",
"is-regex": "^1.1.1", "is-regex": "^1.1.1",
"object-inspect": "^1.8.0", "object-inspect": "^1.8.0",
"object-keys": "^1.1.1", "object-keys": "^1.1.1",
@ -2029,9 +2033,9 @@
} }
}, },
"eslint": { "eslint": {
"version": "7.13.0", "version": "7.14.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.13.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.14.0.tgz",
"integrity": "sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ==", "integrity": "sha512-5YubdnPXrlrYAFCKybPuHIAH++PINe1pmKNc5wQRB9HSbqIK1ywAnntE3Wwua4giKu0bjligf1gLF6qxMGOYRA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
@ -3219,9 +3223,9 @@
} }
}, },
"is-core-module": { "is-core-module": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
"integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"has": "^1.0.3" "has": "^1.0.3"
@ -4606,6 +4610,27 @@
"es-abstract": "^1.17.0-next.1", "es-abstract": "^1.17.0-next.1",
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"has": "^1.0.3" "has": "^1.0.3"
},
"dependencies": {
"es-abstract": {
"version": "1.17.7",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz",
"integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.1",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1"
}
}
} }
}, },
"once": { "once": {
@ -4647,9 +4672,9 @@
} }
}, },
"p-each-series": { "p-each-series": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.1.0.tgz", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz",
"integrity": "sha512-ZuRs1miPT4HrjFa+9fRfOFXxGJfORgelKV9f9nNOWw2gl6gVsRaVDOQP0+MI0G0wGKns1Yacsu0GjOFbTK0JFQ==", "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==",
"dev": true "dev": true
}, },
"p-finally": { "p-finally": {
@ -4800,9 +4825,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "2.1.2", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.0.tgz",
"integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", "integrity": "sha512-yYerpkvseM4iKD/BXLYUkQV5aKt4tQPqaGW6EsZjzyu0r7sVZZNPJW4Y8MyKmicp6t42XUPcBVA+H6sB3gqndw==",
"dev": true "dev": true
}, },
"prettier-linter-helpers": { "prettier-linter-helpers": {
@ -5709,67 +5734,23 @@
} }
}, },
"string.prototype.trimend": { "string.prototype.trimend": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz",
"integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==",
"dev": true, "dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "call-bind": "^1.0.0",
"es-abstract": "^1.18.0-next.1" "define-properties": "^1.1.3"
},
"dependencies": {
"es-abstract": {
"version": "1.18.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
"integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
"is-negative-zero": "^2.0.0",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.1",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1"
}
}
} }
}, },
"string.prototype.trimstart": { "string.prototype.trimstart": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz",
"integrity": "sha512-7F6CdBTl5zyu30BJFdzSTlSlLPwODC23Od+iLoVH8X6+3fvDPPuBVVj9iaB1GOsSTSIgVfsfm27R2FGrAPznWg==", "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==",
"dev": true, "dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "call-bind": "^1.0.0",
"es-abstract": "^1.18.0-next.1" "define-properties": "^1.1.3"
},
"dependencies": {
"es-abstract": {
"version": "1.18.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
"integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
"is-negative-zero": "^2.0.0",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.1",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1"
}
}
} }
}, },
"strip-ansi": { "strip-ansi": {
@ -6063,9 +6044,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "4.0.5", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz",
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==", "integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==",
"dev": true "dev": true
}, },
"union-value": { "union-value": {

View File

@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.8.0", "version": "2.9.0",
"private": false, "private": false,
"description": "Setup PHP for use with GitHub Actions", "description": "Setup PHP for use with GitHub Actions",
"main": "dist/index.js", "main": "dist/index.js",
@ -31,11 +31,11 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.15", "@types/jest": "^26.0.15",
"@types/node": "^14.14.7", "@types/node": "^14.14.10",
"@typescript-eslint/eslint-plugin": "^4.7.0", "@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.7.0", "@typescript-eslint/parser": "^4.8.2",
"@zeit/ncc": "^0.22.3", "@zeit/ncc": "^0.22.3",
"eslint": "^7.13.0", "eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0", "eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3", "eslint-plugin-jest": "^24.1.3",
@ -43,9 +43,9 @@
"husky": "^4.3.0", "husky": "^4.3.0",
"jest": "^26.6.3", "jest": "^26.6.3",
"jest-circus": "^26.6.3", "jest-circus": "^26.6.3",
"prettier": "^2.1.2", "prettier": "^2.2.0",
"ts-jest": "^26.4.4", "ts-jest": "^26.4.4",
"typescript": "^4.0.5" "typescript": "^4.1.2"
}, },
"husky": { "husky": {
"skipCI": true, "skipCI": true,

View File

@ -30,14 +30,7 @@ export async function addCoverageXdebug(
'Xdebug enabled as coverage driver', 'Xdebug enabled as coverage driver',
os_version os_version
); );
switch (true) { return [xdebug, ini, log].join('\n');
case /^xdebug3$/.test(extension):
case /^8\.\d$/.test(version):
return '\n' + xdebug + '\n' + ini + '\n' + log;
case /^xdebug$/.test(extension):
default:
return xdebug + '\n' + log;
}
} }
/** /**

View File

@ -43,7 +43,9 @@ export async function addExtensionDarwin(
); );
return; return;
// match pre-release versions. For example - xdebug-beta // match pre-release versions. For example - xdebug-beta
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(
version_extension
):
add_script += await utils.joins( add_script += await utils.joins(
'\nadd_unstable_extension', '\nadd_unstable_extension',
ext_name, ext_name,
@ -135,11 +137,11 @@ export async function addExtensionWindows(
); );
return; return;
// match pre-release versions. For example - xdebug-beta // match pre-release versions. For example - xdebug-beta
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.*-(stable|beta|alpha|devel|snapshot)/.test(version_extension):
add_script += await utils.joins( add_script += await utils.joins(
'\nAdd-Extension', '\nAdd-Extension',
ext_name, ext_name,
ext_version ext_version.replace('stable', '')
); );
break; break;
// match semver without state // match semver without state
@ -164,6 +166,9 @@ export async function addExtensionWindows(
); );
break; break;
// match 5.3pcov to 7.0pcov // match 5.3pcov to 7.0pcov
case /7\.2xdebug/.test(version_extension):
add_script += '\nAdd-Extension xdebug stable 2.9.8';
break;
case /(5\.[3-6]|7\.0)pcov/.test(version_extension): case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
add_script += await utils.getUnsupportedLog('pcov', version, 'win32'); add_script += await utils.getUnsupportedLog('pcov', version, 'win32');
break; break;
@ -243,7 +248,9 @@ export async function addExtensionLinux(
); );
return; return;
// match pre-release versions. For example - xdebug-beta // match pre-release versions. For example - xdebug-beta
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(
version_extension
):
add_script += await utils.joins( add_script += await utils.joins(
'\nadd_unstable_extension', '\nadd_unstable_extension',
ext_name, ext_name,
@ -269,6 +276,15 @@ export async function addExtensionLinux(
add_script += add_script +=
'\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension'; '\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension';
return; return;
// match 7.2xdebug
case /^7\.2xdebug$/.test(version_extension):
add_script += await utils.joins(
'\nadd_pecl_extension',
ext_name,
'2.9.8',
ext_prefix
);
break;
// match 8.0xdebug3...8.9xdebug3 // match 8.0xdebug3...8.9xdebug3
case /^8\.[0-9]xdebug3$/.test(version_extension): case /^8\.[0-9]xdebug3$/.test(version_extension):
extension = 'xdebug'; extension = 'xdebug';

View File

@ -2,7 +2,6 @@
export tick="✓" export tick="✓"
export cross="✗" export cross="✗"
export curl_opts=(-sL) export curl_opts=(-sL)
export nightly_versions="8.[0-1]"
export old_versions="5.[3-5]" export old_versions="5.[3-5]"
export tool_path_dir="/usr/local/bin" export tool_path_dir="/usr/local/bin"
export composer_bin="$HOME/.composer/vendor/bin" export composer_bin="$HOME/.composer/vendor/bin"
@ -75,7 +74,7 @@ run_script() {
repo=$1 repo=$1
shift shift
args=("$@") args=("$@")
get -q -e /tmp/install.sh "$github/$repo/$latest/install.sh" "$bintray/php/$repo.sh" get -q -e /tmp/install.sh "$bintray/php/$repo.sh" "$github/$repo/$latest/install.sh"
bash /tmp/install.sh "${args[@]}" bash /tmp/install.sh "${args[@]}"
} }
@ -113,7 +112,7 @@ enable_extension() {
# Function to configure PECL. # Function to configure PECL.
configure_pecl() { configure_pecl() {
if ! [ -e /tmp/pecl_config ] && command -v pecl >/dev/null; then if ! [ -e /tmp/pecl_config ] && command -v pecl >/dev/null && command -v pear >/dev/null; then
for script in pear pecl; do for script in pear pecl; do
sudo "$script" config-set php_ini "${pecl_file:-$ini_file}" sudo "$script" config-set php_ini "${pecl_file:-$ini_file}"
sudo "$script" channel-update "$script".php.net sudo "$script" channel-update "$script".php.net
@ -125,12 +124,12 @@ configure_pecl() {
# Function to get the PECL version of an extension. # Function to get the PECL version of an extension.
get_pecl_version() { get_pecl_version() {
extension=$1 extension=$1
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot|preview)")" stability="$(echo "$2" | grep -m 1 -Eio "(stable|alpha|beta|rc|snapshot|preview)")"
pecl_rest='https://pecl.php.net/rest/r/' pecl_rest='https://pecl.php.net/rest/r/'
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml) response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
pecl_version=$(echo "$response" | grep -m 1 -Pio "(\d*\.\d*\.\d*$stability\d*)") pecl_version=$(echo "$response" | grep -m 1 -Eio "([0-9]+\.[0-9]+\.[0-9]+${stability}[0-9]+)")
if [ ! "$pecl_version" ]; then if [ ! "$pecl_version" ]; then
pecl_version=$(echo "$response" | grep -m 1 -Po "(\d*\.\d*\.\d*)") pecl_version=$(echo "$response" | grep -m 1 -Eo "([0-9]+\.[0-9]+\.[0-9]+)")
fi fi
echo "$pecl_version" echo "$pecl_version"
} }
@ -138,6 +137,7 @@ get_pecl_version() {
# Function to install PECL extensions and accept default options # Function to install PECL extensions and accept default options
pecl_install() { pecl_install() {
local extension=$1 local extension=$1
configure_pecl >/dev/null 2>&1
yes '' 2>/dev/null | sudo pecl install -f "$extension" >/dev/null 2>&1 yes '' 2>/dev/null | sudo pecl install -f "$extension" >/dev/null 2>&1
} }

View File

@ -11,7 +11,7 @@ self_hosted_helper() {
remove_extension() { remove_extension() {
extension=$1 extension=$1
if check_extension "$extension"; then if check_extension "$extension"; then
sudo sed -i '' "/$extension/d" "${ini_file:?}" sudo sed -Ei '' "/=(.*\/)?\"?$extension/d" "${ini_file:?}"
sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1 sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") || (! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}" add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}"
@ -39,6 +39,14 @@ add_pecl_extension() {
fi fi
} }
# Function to add a brew tap.
add_brew_tap() {
tap=$1
if ! [ -d "$tap_dir/$tap" ]; then
brew tap --shallow "$tap" >/dev/null 2>&1
fi
}
# Function to install a php extension from shivammathur/extensions tap. # Function to install a php extension from shivammathur/extensions tap.
add_brew_extension() { add_brew_extension() {
extension=$1 extension=$1
@ -47,11 +55,10 @@ add_brew_extension() {
if check_extension "$extension"; then if check_extension "$extension"; then
add_log "${tick:?}" "$extension" "Enabled" add_log "${tick:?}" "$extension" "Enabled"
else else
if ! brew tap | grep -q shivammathur/extensions; then add_brew_tap shivammathur/homebrew-extensions
brew tap --shallow shivammathur/extensions >/dev/null 2>&1 sudo mv "$tap_dir"/shivammathur/homebrew-extensions/.github/deps/"$extension"/* "$tap_dir/homebrew/homebrew-core/Formula/" 2>/dev/null || true
fi
brew install "$extension@$version" >/dev/null 2>&1 brew install "$extension@$version" >/dev/null 2>&1
sudo cp "$(brew --prefix)/opt/$extension@$version/$extension.so" "$ext_dir" sudo cp "$brew_prefix/opt/$extension@$version/$extension.so" "$ext_dir"
add_extension_log "$extension" "Installed and enabled" add_extension_log "$extension" "Installed and enabled"
fi fi
} }
@ -86,7 +93,6 @@ add_pecl() {
# Function to update dependencies. # Function to update dependencies.
update_dependencies() { update_dependencies() {
if [[ "$version" =~ ${nightly_versions:?} ]] && [ "${runner:?}" != "self-hosted" ]; then if [[ "$version" =~ ${nightly_versions:?} ]] && [ "${runner:?}" != "self-hosted" ]; then
tap_dir="$(brew --prefix)/Homebrew/Library/Taps"
while read -r formula; do while read -r formula; do
get -q -n "$tap_dir/homebrew/homebrew-core/Formula/$formula.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$formula.rb" & get -q -n "$tap_dir/homebrew/homebrew-core/Formula/$formula.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$formula.rb" &
to_wait+=($!) to_wait+=($!)
@ -98,16 +104,14 @@ update_dependencies() {
# Function to setup PHP 5.6 and newer using Homebrew. # Function to setup PHP 5.6 and newer using Homebrew.
add_php() { add_php() {
action=$1 action=$1
if ! brew tap | grep -q shivammathur/php; then add_brew_tap shivammathur/homebrew-php
brew tap --shallow shivammathur/php
fi
update_dependencies update_dependencies
if brew list php@"$version" 2>/dev/null | grep -q "Error" && [ "$action" != "upgrade" ]; then if ! [[ "$(find "$(brew --cellar)"/php/ -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]] && [ "$action" != "upgrade" ]; then
brew unlink php@"$version" brew unlink shivammathur/php/php@"$version"
else else
brew "$action" shivammathur/php/php@"$version" brew upgrade "shivammathur/php/php@$version" 2>/dev/null || brew install "shivammathur/php/php@$version"
fi fi
brew link --force --overwrite php@"$version" brew link --force --overwrite shivammathur/php/php@"$version"
} }
# Function to Setup PHP # Function to Setup PHP
@ -129,11 +133,11 @@ setup_php() {
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
sudo chmod 777 "$ini_file" "${tool_path_dir:?}" sudo chmod 777 "$ini_file" "${tool_path_dir:?}"
echo -e "date.timezone=UTC\nmemory_limit=-1" >>"$ini_file" echo -e "date.timezone=UTC\nmemory_limit=-1" >>"$ini_file"
[[ "$version" =~ ${jit_versions:?} ]] && echo -e "opcache.enable=1\nopcache.jit_buffer_size=256M\nopcache.jit=1235" >>"$ini_file"
ext_dir=$(php -i | grep -Ei "extension_dir => /" | sed -e "s|.*=> s*||") ext_dir=$(php -i | grep -Ei "extension_dir => /" | sed -e "s|.*=> s*||")
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||") scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer" sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer"
semver=$(php -v | head -n 1 | cut -f 2 -d ' ') semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
if [[ ! "$version" =~ $old_versions ]]; then configure_pecl >/dev/null 2>&1; fi
sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/" sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
add_log "$tick" "PHP" "$status PHP $semver" add_log "$tick" "PHP" "$status PHP $semver"
} }
@ -141,6 +145,10 @@ setup_php() {
# Variables # Variables
version=$1 version=$1
dist=$2 dist=$2
nightly_versions="8.1"
jit_versions="8.[0-1]"
brew_prefix="$(brew --prefix)"
tap_dir="$brew_prefix"/Homebrew/Library/Taps
export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_NO_INSTALL_CLEANUP=1
export HOMEBREW_NO_AUTO_UPDATE=1 export HOMEBREW_NO_AUTO_UPDATE=1

View File

@ -48,8 +48,8 @@ install_packages() {
# Function to delete extensions. # Function to delete extensions.
delete_extension() { delete_extension() {
extension=$1 extension=$1
sudo sed -i "/$extension/d" "${ini_file:?}" sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${ini_file:?}"
sudo sed -i "/$extension/d" "${pecl_file:?}" sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${pecl_file:?}"
sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1 sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1
if [ "${runner:?}" = "self-hosted" ]; then if [ "${runner:?}" = "self-hosted" ]; then
$apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true $apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true
@ -160,9 +160,7 @@ add_devtools() {
fi fi
sudo update-alternatives --set php-config /usr/bin/php-config"$version" >/dev/null 2>&1 sudo update-alternatives --set php-config /usr/bin/php-config"$version" >/dev/null 2>&1
sudo update-alternatives --set phpize /usr/bin/phpize"$version" >/dev/null 2>&1 sudo update-alternatives --set phpize /usr/bin/phpize"$version" >/dev/null 2>&1
if command -v pecl >/dev/null; then configure_pecl >/dev/null 2>&1
configure_pecl >/dev/null 2>&1
fi
add_log "${tick:?}" "$tool" "Added $tool $semver" add_log "${tick:?}" "$tool" "Added $tool $semver"
} }
@ -174,7 +172,6 @@ setup_nightly() {
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5. # Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
setup_old_versions() { setup_old_versions() {
run_script "php5-ubuntu" "$version" run_script "php5-ubuntu" "$version"
configure_pecl
release_version=$(php -v | head -n 1 | cut -d' ' -f 2) release_version=$(php -v | head -n 1 | cut -d' ' -f 2)
} }
@ -274,6 +271,7 @@ setup_php() {
# Variables # Variables
version=$1 version=$1
dist=$2 dist=$2
nightly_versions="8.[0-1]"
debconf_fix="DEBIAN_FRONTEND=noninteractive" debconf_fix="DEBIAN_FRONTEND=noninteractive"
apt_install="sudo $debconf_fix apt-fast install -y" apt_install="sudo $debconf_fix apt-fast install -y"
apt_remove="sudo $debconf_fix apt-fast remove -y" apt_remove="sudo $debconf_fix apt-fast remove -y"

View File

@ -14,13 +14,12 @@ add_bazel() {
get_grpc_tag() { get_grpc_tag() {
if [ "$grpc_tag" = "latest" ]; then if [ "$grpc_tag" = "latest" ]; then
grpc_tag=$(get -s -n "" https://grpc.io/release) grpc_tag=$(get -s -n "" https://github.com/grpc/grpc/releases/latest | grep -Eo -m 1 "v[0-9]+\.[0-9]+\.[0-9]+" | head -n 1)
else else
status_code=$(get -v -n /tmp/grpc.tmp "https://github.com/grpc/grpc/releases/tag/v$grpc_tag") if [[ ${grpc_tag:0:1} != "v" ]] ; then grpc_tag="v$grpc_tag"; fi
if [ "$status_code" = "200" ]; then status_code=$(get -v -n /tmp/grpc.tmp "https://github.com/grpc/grpc/releases/tag/$grpc_tag")
grpc_tag="v$grpc_tag" if [ "$status_code" != "200" ]; then
else grpc_tag=$(get -s -n "" https://github.com/grpc/grpc/releases/latest | grep -Eo -m 1 "v[0-9]+\.[0-9]+\.[0-9]+" | head -n 1)
grpc_tag=$(get -s -n "" https://grpc.io/release)
fi fi
fi fi
} }

View File

@ -8,10 +8,7 @@ param (
[ValidateNotNull()] [ValidateNotNull()]
[ValidateLength(1, [int]::MaxValue)] [ValidateLength(1, [int]::MaxValue)]
[string] [string]
$dist, $dist
[Parameter(Position = 2, Mandatory = $false)]
[string]
$fail_fast = 'false'
) )
# Function to log start of a operation. # Function to log start of a operation.
@ -25,7 +22,7 @@ Function Add-Log($mark, $subject, $message) {
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
} else { } else {
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
if($fail_fast -eq 'true') { if($env:fail_fast -eq 'true') {
exit 1; exit 1;
} }
} }
@ -222,12 +219,12 @@ Function Get-ToolVersion() {
$version_regex = "[0-9]+((\.{1}[0-9]+)+)(\.{0})(-[a-z0-9]+){0,1}" $version_regex = "[0-9]+((\.{1}[0-9]+)+)(\.{0})(-[a-z0-9]+){0,1}"
if($tool -eq 'composer') { if($tool -eq 'composer') {
if ($param -eq 'snapshot') { if ($param -eq 'snapshot') {
$trunk = Select-String -Pattern "const\sBRANCH_ALIAS_VERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern $version_regex | ForEach-Object { $_.matches.Value } $composer_version = (Select-String -Pattern "const\sBRANCH_ALIAS_VERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern $version_regex | ForEach-Object { $_.matches.Value }) + '+' + (Select-String -Pattern "const\sVERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern "[a-zA-Z0-9]+" -AllMatches | ForEach-Object { $_.matches[2].Value })
$commit = Select-String -Pattern "const\sVERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern "[a-zA-Z0-9]+" -AllMatches | ForEach-Object { $_.matches[2].Value }
return "$trunk+$commit"
} else { } else {
return Select-String -Pattern "const\sVERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern $version_regex | ForEach-Object { $_.matches.Value } $composer_version = Select-String -Pattern "const\sVERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern $version_regex | ForEach-Object { $_.matches.Value }
} }
Set-Variable -Name 'composer_version' -Value $composer_version -Scope Global
return "$composer_version"
} }
return . $tool $param 2> $null | ForEach-Object { $_ -replace "composer $version_regex", '' } | Select-String -Pattern $version_regex | Select-Object -First 1 | ForEach-Object { $_.matches.Value } return . $tool $param 2> $null | ForEach-Object { $_ -replace "composer $version_regex", '' } | Select-String -Pattern $version_regex | Select-Object -First 1 | ForEach-Object { $_.matches.Value }
} }
@ -310,6 +307,11 @@ Function Add-Composertool() {
[string] [string]
$prefix $prefix
) )
if($tool -match "prestissimo|composer-prefetcher" -and $composer_version.split('.')[0] -ne "1") {
Write-Output "::warning:: Skipping $tool, as it does not support Composer $composer_version. Specify composer:v1 in tools to use $tool"
Add-Log $cross $tool "Skipped"
Return
}
composer global require $prefix$release 2>&1 | out-null composer global require $prefix$release 2>&1 | out-null
$json = findstr $prefix$tool $env:APPDATA\Composer\composer.json $json = findstr $prefix$tool $env:APPDATA\Composer\composer.json
if(Test-Path $composer_bin\composer) { if(Test-Path $composer_bin\composer) {
@ -411,9 +413,9 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
} }
$installed = Get-Php -Path $php_dir $installed = Get-Php -Path $php_dir
('date.timezone=UTC', 'memory_limit=-1') | foreach { $p=$_.split('='); Set-PhpIniKey -Key $p[0] -Value $p[1] -Path $php_dir } ('date.timezone=UTC', 'memory_limit=-1') | ForEach-Object { $p=$_.split('='); Set-PhpIniKey -Key $p[0] -Value $p[1] -Path $php_dir }
if($version -lt "5.5") { if($version -lt "5.5") {
('libeay32.dll', 'ssleay32.dll') | ForEach { Invoke-WebRequest -Uri $bintray/$_ -OutFile $php_dir\$_ >$null 2>&1 } ('libeay32.dll', 'ssleay32.dll') | ForEach-Object { Invoke-WebRequest -Uri $bintray/$_ -OutFile $php_dir\$_ >$null 2>&1 }
} else { } else {
$enable_extensions += ('opcache') $enable_extensions += ('opcache')
} }

View File

@ -306,14 +306,10 @@ export async function getWpCliUrl(version: string): Promise<string> {
export async function addComposer(tools_list: string[]): Promise<string[]> { export async function addComposer(tools_list: string[]): Promise<string[]> {
const regex_any = /^composer($|:.*)/; const regex_any = /^composer($|:.*)/;
const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$|v?\d+\.\d+\.\d+[\w-]*$)/; const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$|v?\d+\.\d+\.\d+[\w-]*$)/;
const regex_composer1_tools = /hirak|prestissimo|narrowspark|composer-prefetcher/;
const matches: string[] = tools_list.filter(tool => regex_valid.test(tool)); const matches: string[] = tools_list.filter(tool => regex_valid.test(tool));
let composer = 'composer'; let composer = 'composer';
tools_list = tools_list.filter(tool => !regex_any.test(tool)); tools_list = tools_list.filter(tool => !regex_any.test(tool));
switch (true) { switch (true) {
case regex_composer1_tools.test(tools_list.join(' ')):
composer = 'composer:1';
break;
case matches[0] == undefined: case matches[0] == undefined:
break; break;
default: default:

View File

@ -49,7 +49,7 @@ export async function getInput(
export async function parseVersion(version: string): Promise<string> { export async function parseVersion(version: string): Promise<string> {
switch (version) { switch (version) {
case 'latest': case 'latest':
return '7.4'; return '8.0';
default: default:
switch (true) { switch (true) {
case version.length > 1: case version.length > 1: