mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-04 22:23:16 +07:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
28c92ba4ee | |||
ffd019edc6 | |||
0e506b34ac | |||
aa0ecfbc6f | |||
f29cd24dbf | |||
2a41b9d1ba |
14
README.md
14
README.md
@ -56,11 +56,12 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
||||||
|----------------------|------------------------------------|------------------------|
|
|----------------------|------------------------------------|------------------------|
|
||||||
| Ubuntu 20.04 | `ubuntu-latest` or `ubuntu-20.04` | `PHP 7.4` to `PHP 8.1` |
|
| Ubuntu 20.04 | `ubuntu-latest` or `ubuntu-20.04` | `PHP 7.4` to `PHP 8.1` |
|
||||||
| Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.1` to `PHP 8.1` |
|
| Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.2` to `PHP 8.1` |
|
||||||
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.1` |
|
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.1` |
|
||||||
| Windows Server 2019 | `windows-2019` | `PHP 8.1` |
|
| Windows Server 2019 | `windows-2019` | `PHP 8.1` |
|
||||||
| macOS 11.x Big Sur | `macos-11` | `PHP 8.1` |
|
| macOS Monterey 12.x | `macos-12` | `PHP 8.1` |
|
||||||
| macOS 10.15 Catalina | `macos-latest` or `macos-10.15` | `PHP 8.1` |
|
| macOS Big Sur 11.x | `macos-latest` or `macos-11` | `PHP 8.1` |
|
||||||
|
| macOS Catalina 10.15 | `macos-10.15` | `PHP 8.1` |
|
||||||
|
|
||||||
## :heavy_plus_sign: PHP Extension Support
|
## :heavy_plus_sign: PHP Extension Support
|
||||||
- On `ubuntu` by default extensions which are available as a package can be installed. If the extension is not available as a package but it is on `PECL`, it can be installed by specifying `pecl` in the tools input.
|
- On `ubuntu` by default extensions which are available as a package can be installed. If the extension is not available as a package but it is on `PECL`, it can be installed by specifying `pecl` in the tools input.
|
||||||
@ -415,6 +416,13 @@ These companies generously provide setup-php their products and services to aid
|
|||||||
<a href="https://tidelift.com/subscription/pkg/npm-setup-php">
|
<a href="https://tidelift.com/subscription/pkg/npm-setup-php">
|
||||||
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="70" height="60">
|
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="70" height="60">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a href="https://www.scaleway.com/en/about-us/open-source-program#gh-light-mode-only">
|
||||||
|
<img src="https://setup-php.com/sponsors/scaleway.png" alt="Scaleway" width="174" height="60">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.scaleway.com/en/about-us/open-source-program#gh-dark-mode-only">
|
||||||
|
<img src="https://setup-php.com/sponsors/scaleway-white.png" alt="Scaleway" width="174" height="60">
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## :bookmark: Dependencies
|
## :bookmark: Dependencies
|
||||||
|
@ -198,37 +198,37 @@ describe('Tools tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('checking getComposerUrl', async () => {
|
it('checking getComposerUrl', async () => {
|
||||||
expect(await tools.getComposerUrl('latest')).toContain(
|
expect(await tools.getComposerUrl('latest', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-stable.phar'
|
'https://getcomposer.org/composer-stable.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('stable')).toContain(
|
expect(await tools.getComposerUrl('stable', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-stable.phar'
|
'https://getcomposer.org/composer-stable.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('snapshot')).toContain(
|
expect(await tools.getComposerUrl('snapshot', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer.phar'
|
'https://getcomposer.org/composer.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('preview')).toContain(
|
expect(await tools.getComposerUrl('preview', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-preview.phar'
|
'https://getcomposer.org/composer-preview.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('1')).toContain(
|
expect(await tools.getComposerUrl('1', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-1.phar'
|
'https://getcomposer.org/composer-1.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('2')).toContain(
|
expect(await tools.getComposerUrl('2', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-2.phar'
|
'https://getcomposer.org/composer-2.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('1.7.2')).toContain(
|
expect(await tools.getComposerUrl('1.7.2', '7.4')).toContain(
|
||||||
'https://github.com/composer/composer/releases/download/1.7.2/composer.phar'
|
'https://github.com/composer/composer/releases/download/1.7.2/composer.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('1.7.2')).toContain(
|
expect(await tools.getComposerUrl('1.7.2', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-1.7.2.phar'
|
'https://getcomposer.org/composer-1.7.2.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('2.0.0-RC2')).toContain(
|
expect(await tools.getComposerUrl('2.0.0-RC2', '7.4')).toContain(
|
||||||
'https://github.com/composer/composer/releases/download/2.0.0-RC2/composer.phar'
|
'https://github.com/composer/composer/releases/download/2.0.0-RC2/composer.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('2.0.0-RC2')).toContain(
|
expect(await tools.getComposerUrl('2.0.0-RC2', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-2.0.0-RC2.phar'
|
'https://getcomposer.org/composer-2.0.0-RC2.phar'
|
||||||
);
|
);
|
||||||
expect(await tools.getComposerUrl('wrong')).toContain(
|
expect(await tools.getComposerUrl('wrong', '7.4')).toContain(
|
||||||
'https://getcomposer.org/composer-stable.phar'
|
'https://getcomposer.org/composer-stable.phar'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -347,7 +347,7 @@ describe('Tools tests', () => {
|
|||||||
'linux'
|
'linux'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
||||||
@ -381,7 +381,7 @@ describe('Tools tests', () => {
|
|||||||
'darwin'
|
'darwin'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr'
|
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr'
|
||||||
@ -418,7 +418,7 @@ describe('Tools tests', () => {
|
|||||||
'win32'
|
'win32'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
||||||
@ -447,7 +447,7 @@ describe('Tools tests', () => {
|
|||||||
'win32'
|
'win32'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-1.phar,https://getcomposer.org/composer-1.phar composer'
|
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer'
|
||||||
);
|
);
|
||||||
expect(script).toContain('Add-Composertool prestissimo prestissimo hirak/');
|
expect(script).toContain('Add-Composertool prestissimo prestissimo hirak/');
|
||||||
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
|
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
|
||||||
@ -462,12 +462,12 @@ describe('Tools tests', () => {
|
|||||||
'linux'
|
'linux'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-1.phar,https://getcomposer.org/composer-1.phar composer'
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer'
|
||||||
);
|
);
|
||||||
|
|
||||||
script = await tools.addTools('composer:preview', '7.4', 'linux');
|
script = await tools.addTools('composer:preview', '7.4', 'linux');
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-preview.phar,https://getcomposer.org/composer-preview.phar composer'
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar,https://getcomposer.org/composer-preview.phar composer'
|
||||||
);
|
);
|
||||||
script = await tools.addTools(
|
script = await tools.addTools(
|
||||||
'composer:v1, composer:preview, composer:snapshot',
|
'composer:v1, composer:preview, composer:snapshot',
|
||||||
@ -475,7 +475,7 @@ describe('Tools tests', () => {
|
|||||||
'linux'
|
'linux'
|
||||||
);
|
);
|
||||||
expect(script).toContain(
|
expect(script).toContain(
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-snapshot.phar,https://getcomposer.org/composer.phar composer'
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar,https://getcomposer.org/composer.phar composer'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
44
dist/index.js
vendored
44
dist/index.js
vendored
@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@ -87,7 +91,11 @@ exports.addINIValues = addINIValues;
|
|||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@ -192,7 +200,11 @@ exports.addCoverage = addCoverage;
|
|||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@ -232,7 +244,7 @@ async function addExtensionDarwin(extension_csv, version) {
|
|||||||
' ' +
|
' ' +
|
||||||
ext_prefix;
|
ext_prefix;
|
||||||
return;
|
return;
|
||||||
case /(5\.6|7\.[0-4]|8.0)(amqp|expect|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(version_extension):
|
case /(5\.6|7\.[0-4]|8.0)(amqp|expect|grpc|igbinary|imagick|imap|mcrypt|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(version_extension):
|
||||||
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
||||||
case /^(5\.6|7\.[0-3])phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
case /^(5\.6|7\.[0-3])phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||||
case /(7\.[0-4]|8\.0])vips/.test(version_extension):
|
case /(7\.[0-4]|8\.0])vips/.test(version_extension):
|
||||||
@ -388,7 +400,11 @@ exports.addExtension = addExtension;
|
|||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@ -492,7 +508,11 @@ exports.run = run;
|
|||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@ -655,8 +675,8 @@ async function addComposer(tools_list) {
|
|||||||
return tools_list;
|
return tools_list;
|
||||||
}
|
}
|
||||||
exports.addComposer = addComposer;
|
exports.addComposer = addComposer;
|
||||||
async function getComposerUrl(version) {
|
async function getComposerUrl(version, php_version) {
|
||||||
let cache_url = `https://github.com/shivammathur/composer-cache/releases/latest/download/composer-${version.replace('latest', 'stable')}.phar`;
|
let cache_url = `https://github.com/shivammathur/composer-cache/releases/latest/download/composer-${php_version}-${version.replace('latest', 'stable')}.phar`;
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^snapshot$/.test(version):
|
case /^snapshot$/.test(version):
|
||||||
return `${cache_url},https://getcomposer.org/composer.phar`;
|
return `${cache_url},https://getcomposer.org/composer.phar`;
|
||||||
@ -750,7 +770,7 @@ async function addTools(tools_csv, php_version, os_version) {
|
|||||||
script += await addArchive(tool, url, os_version);
|
script += await addArchive(tool, url, os_version);
|
||||||
break;
|
break;
|
||||||
case 'composer':
|
case 'composer':
|
||||||
url = await getComposerUrl(version);
|
url = await getComposerUrl(version, php_version);
|
||||||
script += await addArchive('composer', url, os_version);
|
script += await addArchive('composer', url, os_version);
|
||||||
break;
|
break;
|
||||||
case 'codeception':
|
case 'codeception':
|
||||||
@ -806,7 +826,11 @@ exports.addTools = addTools;
|
|||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
572
package-lock.json
generated
572
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
30
package.json
30
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "1.11.6",
|
"version": "1.11.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Setup PHP for use with GitHub Actions",
|
"description": "Setup PHP for use with GitHub Actions",
|
||||||
"main": "lib/install.js",
|
"main": "lib/install.js",
|
||||||
@ -35,27 +35,27 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.6.0",
|
||||||
"@actions/exec": "^1.1.0",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.1",
|
"@actions/io": "^1.1.2",
|
||||||
"fs": "0.0.1-security"
|
"fs": "0.0.1-security"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.1",
|
||||||
"@types/node": "^17.0.16",
|
"@types/node": "^17.0.23",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
||||||
"@typescript-eslint/parser": "^5.11.0",
|
"@typescript-eslint/parser": "^5.18.0",
|
||||||
"@vercel/ncc": "^0.33.1",
|
"@vercel/ncc": "^0.33.3",
|
||||||
"eslint": "^8.8.0",
|
"eslint": "^8.13.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-import": "^2.25.4",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-jest": "^26.1.0",
|
"eslint-plugin-jest": "^26.1.4",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"jest": "^27.5.1",
|
"jest": "^27.5.1",
|
||||||
"jest-circus": "^27.5.1",
|
"jest-circus": "^27.5.1",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.6.2",
|
||||||
"simple-git-hooks": "^2.7.0",
|
"simple-git-hooks": "^2.7.0",
|
||||||
"ts-jest": "^27.1.3",
|
"ts-jest": "^27.1.4",
|
||||||
"typescript": "^4.5.5"
|
"typescript": "^4.6.3"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||||
|
@ -33,7 +33,7 @@ export async function addExtensionDarwin(
|
|||||||
// match 5.6 to 8.0 amqp, expect, grpc, igbinary, imagick, imap, mongodb, msgpack, pecl_http, propro, protobuf, raphf, rdkafka, redis, ssh2, swoole, xdebug, xdebug2, yaml, zmq
|
// match 5.6 to 8.0 amqp, expect, grpc, igbinary, imagick, imap, mongodb, msgpack, pecl_http, propro, protobuf, raphf, rdkafka, redis, ssh2, swoole, xdebug, xdebug2, yaml, zmq
|
||||||
// match 7.1pcov to 8.0pcov
|
// match 7.1pcov to 8.0pcov
|
||||||
// match 7.0vips to 8.0vips
|
// match 7.0vips to 8.0vips
|
||||||
case /(5\.6|7\.[0-4]|8.0)(amqp|expect|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
|
case /(5\.6|7\.[0-4]|8.0)(amqp|expect|grpc|igbinary|imagick|imap|mcrypt|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
||||||
|
@ -242,31 +242,39 @@ link_libraries() {
|
|||||||
formula_prefix="$(brew --prefix "$formula")"
|
formula_prefix="$(brew --prefix "$formula")"
|
||||||
sudo mkdir -p "$formula_prefix"/lib
|
sudo mkdir -p "$formula_prefix"/lib
|
||||||
for lib in "$formula_prefix"/lib/*.dylib; do
|
for lib in "$formula_prefix"/lib/*.dylib; do
|
||||||
[ -f "$lib" ] || break
|
|
||||||
lib_name=$(basename "$lib")
|
lib_name=$(basename "$lib")
|
||||||
sudo cp -a "$lib" "$brew_prefix/lib/$lib_name" 2>/dev/null || true
|
sudo cp -a "$lib" "$brew_prefix/lib/$lib_name" 2>/dev/null || true
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
patch_brew() {
|
patch_brew() {
|
||||||
sudo sed -i '' "s/ keg.link(verbose: verbose?)/ keg.link(verbose: verbose?, overwrite: true)/" "$brew_repo"/Library/Homebrew/formula_installer.rb
|
formula_installer="$brew_repo"/Library/Homebrew/formula_installer.rb
|
||||||
|
code=" keg.link\(verbose: verbose\?"
|
||||||
|
sudo sed -Ei '' "s/$code.*/$code, overwrite: true\)/" "$formula_installer"
|
||||||
# shellcheck disable=SC2064
|
# shellcheck disable=SC2064
|
||||||
trap "git -C $brew_repo stash >/dev/null 2>&1" exit
|
trap "sudo sed -Ei '' 's/$code.*/$code, overwrite: overwrite?\)/' $formula_installer" exit
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper function to update the dependencies.
|
||||||
|
update_dependencies_helper() {
|
||||||
|
dependency=$1
|
||||||
|
curl -o "$tap_dir/homebrew/homebrew-core/Formula/$formula.rb" "${curl_opts[@]}" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$formula.rb"
|
||||||
|
link_libraries "$dependency"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to update dependencies
|
# Function to update dependencies
|
||||||
update_dependencies() {
|
update_dependencies() {
|
||||||
|
if ! [ -e /tmp/update_dependencies ]; then
|
||||||
if [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
|
if [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
|
||||||
patch_brew
|
patch_brew
|
||||||
while read -r formula; do
|
while read -r dependency; do
|
||||||
(
|
update_dependencies_helper "$dependency" &
|
||||||
curl -o "$tap_dir/homebrew/homebrew-core/Formula/$formula.rb" "${curl_opts[@]}" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$formula.rb"
|
to_wait+=($!)
|
||||||
link_libraries "$formula"
|
done <"$tap_dir/shivammathur/homebrew-php/.github/deps/${ImageOS:?}_${ImageVersion:?}"
|
||||||
) &
|
|
||||||
to_wait+=( $! )
|
|
||||||
done < "$tap_dir/shivammathur/homebrew-php/.github/deps/${ImageOS:?}_${ImageVersion:?}"
|
|
||||||
wait "${to_wait[@]}"
|
wait "${to_wait[@]}"
|
||||||
fi
|
fi
|
||||||
|
echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to get PHP version if it is already installed using Homebrew.
|
# Function to get PHP version if it is already installed using Homebrew.
|
||||||
|
@ -245,8 +245,11 @@ export async function addComposer(tools_list: string[]): Promise<string[]> {
|
|||||||
*
|
*
|
||||||
* @param version
|
* @param version
|
||||||
*/
|
*/
|
||||||
export async function getComposerUrl(version: string): Promise<string> {
|
export async function getComposerUrl(
|
||||||
let cache_url = `https://github.com/shivammathur/composer-cache/releases/latest/download/composer-${version.replace(
|
version: string,
|
||||||
|
php_version: string
|
||||||
|
): Promise<string> {
|
||||||
|
let cache_url = `https://github.com/shivammathur/composer-cache/releases/latest/download/composer-${php_version}-${version.replace(
|
||||||
'latest',
|
'latest',
|
||||||
'stable'
|
'stable'
|
||||||
)}.phar`;
|
)}.phar`;
|
||||||
@ -415,7 +418,7 @@ export async function addTools(
|
|||||||
script += await addArchive(tool, url, os_version);
|
script += await addArchive(tool, url, os_version);
|
||||||
break;
|
break;
|
||||||
case 'composer':
|
case 'composer':
|
||||||
url = await getComposerUrl(version);
|
url = await getComposerUrl(version, php_version);
|
||||||
script += await addArchive('composer', url, os_version);
|
script += await addArchive('composer', url, os_version);
|
||||||
break;
|
break;
|
||||||
case 'codeception':
|
case 'codeception':
|
||||||
|
Reference in New Issue
Block a user