Skip to content

Commit

Permalink
Merge pull request #313 from shivammathur/develop
Browse files Browse the repository at this point in the history
2.7.0
  • Loading branch information
shivammathur committed Oct 19, 2020
2 parents 073c2e6 + c5d41cd commit 3c0527b
Show file tree
Hide file tree
Showing 18 changed files with 963 additions and 695 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Expand Up @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest]
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
env:
extensions: xml, opcache, xdebug, pcov
key: cache-v3
Expand Down
135 changes: 93 additions & 42 deletions README.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions __tests__/coverage.test.ts
Expand Up @@ -53,6 +53,18 @@ describe('Config tests', () => {
expect(linux).toContain('echo "xdebug.mode=coverage"');
});

it('checking addCoverage with Xdebug3 on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug3', '8.1', 'linux');
expect(linux).toContain('add_extension xdebug');
expect(linux).toContain('echo "xdebug.mode=coverage"');
});

it('checking addCoverage with Xdebug on linux', async () => {
const linux: string = await coverage.addCoverage('xdebug', '8.1', 'linux');
expect(linux).toContain('add_extension xdebug');
expect(linux).toContain('echo "xdebug.mode=coverage"');
});

it('checking addCoverage with Xdebug on darwin', async () => {
const darwin: string = await coverage.addCoverage(
'xdebug',
Expand Down
12 changes: 5 additions & 7 deletions __tests__/extensions.test.ts
Expand Up @@ -70,7 +70,7 @@ describe('Extension tests', () => {
'sudo $debconf_fix apt-get install -y php7.4-sqlite3'
);
expect(linux).toContain('remove_extension intl');
expect(linux).toContain('sudo $debconf_fix apt-get install -y php-ast');
expect(linux).toContain('sudo $debconf_fix apt-get install -y php7.4-ast');
expect(linux).toContain('sudo $debconf_fix apt-get install -y php-uopz');
expect(linux).toContain('add_unstable_extension ast beta extension');
expect(linux).toContain('add_pdo_extension mysql');
Expand Down Expand Up @@ -129,13 +129,15 @@ describe('Extension tests', () => {

it('checking addExtensionOnDarwin', async () => {
let darwin: string = await extensions.addExtension(
'Xdebug, pcov, grpc, protobuf, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
'Xdebug, pcov, grpc, igbinary, imagick, protobuf, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
'7.2',
'darwin'
);
expect(darwin).toContain('add_brew_extension xdebug');
expect(darwin).toContain('add_brew_extension pcov');
expect(darwin).toContain('add_brew_extension grpc');
expect(darwin).toContain('add_brew_extension igbinary');
expect(darwin).toContain('add_brew_extension imagick');
expect(darwin).toContain('add_brew_extension protobuf');
expect(darwin).toContain('add_brew_extension swoole');
expect(darwin).toContain('pecl_install sqlite3');
Expand Down Expand Up @@ -179,11 +181,7 @@ describe('Extension tests', () => {
darwin = await extensions.addExtension('redis', '7.2', 'darwin');
expect(darwin).toContain('pecl_install redis');

darwin = await extensions.addExtension('imagick', '5.6', 'darwin');
expect(darwin).toContain('brew install pkg-config imagemagick');
expect(darwin).toContain('pecl_install imagick');

darwin = await extensions.addExtension('imagick', '7.4', 'darwin');
darwin = await extensions.addExtension('imagick', '5.5', 'darwin');
expect(darwin).toContain('brew install pkg-config imagemagick');
expect(darwin).toContain('pecl_install imagick');

Expand Down
6 changes: 6 additions & 0 deletions __tests__/install.test.ts
Expand Up @@ -165,5 +165,11 @@ describe('Install', () => {
script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash darwin.sh 8.0 ' + __dirname);

setEnv(8.1, 'darwin', '', '', '', '');

script = '' + (await install.run());
expect(script).toContain('initial script');
expect(script).toContain('bash darwin.sh 8.1 ' + __dirname);
});
});
4 changes: 2 additions & 2 deletions __tests__/tools.test.ts
Expand Up @@ -349,12 +349,12 @@ describe('Tools tests', () => {

script = await tools.addDevTools('phpize', 'win32');
expect(script).toContain(
'Add-Log "$cross" "phpize" "phpize is not a windows tool"'
'Add-Log "$tick" "phpize" "phpize is not a windows tool"'
);

script = await tools.addDevTools('php-config', 'win32');
expect(script).toContain(
'Add-Log "$cross" "php-config" "php-config is not a windows tool"'
'Add-Log "$tick" "php-config" "php-config is not a windows tool"'
);

script = await tools.addDevTools('tool', 'openbsd');
Expand Down
39 changes: 20 additions & 19 deletions dist/index.js
Expand Up @@ -2084,7 +2084,7 @@ async function addDevTools(tool, os_version) {
case 'darwin':
return 'add_devtools ' + tool;
case 'win32':
return await utils.addLog('$cross', tool, tool + ' is not a windows tool', 'win32');
return await utils.addLog('$tick', tool, tool + ' is not a windows tool', 'win32');
default:
return await utils.log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
Expand Down Expand Up @@ -2314,7 +2314,7 @@ async function addCoverageXdebug(extension, version, os_version, pipe) {
const log = await utils.addLog('$tick', extension, 'Xdebug enabled as coverage driver', os_version);
switch (true) {
case /^xdebug3$/.test(extension):
case /^8\.0$/.test(version):
case /^8\.\d$/.test(version):
return '\n' + xdebug + '\n' + ini + '\n' + log;
case /^xdebug$/.test(extension):
default:
Expand Down Expand Up @@ -2583,7 +2583,8 @@ async function run() {
const tool = await utils.scriptTool(os_version);
const script = os_version + (await utils.scriptExtension(os_version));
const location = await getScript(script, version, os_version);
await exec_1.exec(await utils.joins(tool, location, version, __dirname));
const fail_fast = await utils.readEnv('fail-fast');
await exec_1.exec(await utils.joins(tool, location, version, __dirname, fail_fast));
}
catch (error) {
core.setFailed(error.message);
Expand Down Expand Up @@ -2862,7 +2863,7 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
remove_script += '\nremove_extension ' + ext_name.slice(1);
return;
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
// match pdo_oci and oci8
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
Expand All @@ -2884,20 +2885,20 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
return;
// match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole
// match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf
// match 7.1pcov to 8.0pcov
case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension):
case /(5\.6|7\.[0-4])(grpc|protobuf|swoole)/.test(version_extension):
// match 5.6xdebug to 8.9xdebug, 5.6igbinary to 8.9igbinary
// match 5.6grpc to 7.4grpc, 5.6imagick to 7.4imagick, 5.6protobuf to 7.4protobuf, 5.6swoole to 7.4swoole
// match 7.1pcov to 8.9pcov
case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|igbinary)/.test(version_extension):
case /(5\.6|7\.[0-4])(grpc|imagick|protobuf|swoole)/.test(version_extension):
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
command = 'add_brew_extension ' + ext_name;
break;
// match 5.6redis
case /5\.6redis/.test(version_extension):
command = command_prefix + 'redis-2.2.8';
break;
// match imagick
case /^imagick$/.test(extension):
// match 5.4imagick and 5.5imagick
case /^5\.[4-5]imagick$/.test(version_extension):
command = await utils.joins('brew install pkg-config imagemagick' + pipe, '&& ' + command_prefix + 'imagick' + pipe);
break;
// match sqlite
Expand Down Expand Up @@ -2934,7 +2935,7 @@ async function addExtensionWindows(extension_csv, version) {
remove_script += '\nRemove-Extension ' + ext_name.slice(1);
break;
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
// match pdo_oci and oci8
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
Expand Down Expand Up @@ -2968,9 +2969,9 @@ async function addExtensionWindows(extension_csv, version) {
add_script +=
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
break;
// match 7.0mysql..8.0mysql
// match 7.0mysqli..8.0mysqli
// match 7.0mysqlnd..8.0mysqlnd
// match 7.0mysql..8.9mysql
// match 7.0mysqli..8.9mysqli
// match 7.0mysqlnd..8.9mysqlnd
case /[7-8]\.\d(mysql|mysqli|mysqlnd)$/.test(version_extension):
add_script += '\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
break;
Expand Down Expand Up @@ -3010,7 +3011,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
remove_script += '\nremove_extension ' + ext_name.slice(1);
return;
// match 5.3blackfire...5.6blackfire, 7.0blackfire...7.4blackfire
// match 5.3blackfire-1.31.0...5.6blackfire-1.31.0, 7.0blackfire-1.31.0...7.4blackfire-1.31.0
// match 5.3blackfire-(semver)...5.6blackfire-(semver), 7.0blackfire-(semver)...7.4blackfire-(semver)
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
// match pdo_oci and oci8
// match 5.3ioncube...7.4ioncube, 7.0ioncube...7.4ioncube
Expand Down Expand Up @@ -3042,7 +3043,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
add_script +=
'\nadd_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension';
return;
// match 8.0xdebug3
// match 8.0xdebug3...8.9xdebug3
case /^8\.[0-9]xdebug3$/.test(version_extension):
extension = 'xdebug';
command = command_prefix + version + '-' + extension + pipe;
Expand All @@ -3052,8 +3053,8 @@ async function addExtensionLinux(extension_csv, version, pipe) {
extension = extension.replace(/pdo[_-]|3/, '');
add_script += '\nadd_pdo_extension ' + extension;
return;
// match ast and uopz
case /^(ast|uopz)$/.test(extension):
// match uopz
case /^(uopz)$/.test(extension):
command = command_prefix + '-' + extension + pipe;
break;
// match sqlite
Expand Down

0 comments on commit 3c0527b

Please sign in to comment.