Compare commits

..

19 Commits
1.4.2 ... 1.4.5

Author SHA1 Message Date
Shivam Mathur
cb5e07baff Merge pull request #67 from shivammathur/develop
Revert action.yml changes
2019-10-29 07:10:37 +05:30
Shivam Mathur
9469267fb3 Revert action.yml changes 2019-10-29 07:01:12 +05:30
Shivam Mathur
1d6dab3cd1 Merge pull request #66 from shivammathur/develop
1.4.5
2019-10-29 06:45:12 +05:30
Shivam Mathur
20d1b1c6f1 Bump version, and update workflow, readme and actions.yml 2019-10-29 06:25:40 +05:30
Shivam Mathur
0d8d5d2f2c Fix side effects of this action 2019-10-29 05:37:39 +05:30
Shivam Mathur
16267e1982 Merge pull request #64 from shivammathur/develop
Speed improvements and fixes for shell change in windows
2019-10-25 05:11:14 +05:30
Shivam Mathur
91d14c7068 Update workflows as powershell is now default on windows 2019-10-25 04:28:19 +05:30
Shivam Mathur
340ab0b95f Fix logs on windows 2019-10-23 15:27:40 +05:30
Shivam Mathur
75c0e130e8 Switch to apt-fast 2019-10-23 03:35:15 +05:30
Shivam Mathur
57a0907a18 Enable ext-curl on windows 2019-10-22 22:56:27 +05:30
Shivam Mathur
3315fa09dc Overwrite existing PHP on windows 2019-10-22 21:59:36 +05:30
Shivam Mathur
b132b4eb7c Merge pull request #62 from shivammathur/develop
PHP 7.4RC4, pdo_* extensions and test workflow.
2019-10-19 21:09:39 +05:30
Shivam Mathur
9145972d5c Edit README and the test workflow 2019-10-19 19:59:48 +05:30
Shivam Mathur
0ac43c03b2 Add timeout to codecov step in the workflow 2019-10-19 19:48:25 +05:30
Shivam Mathur
46f009cce1 Fix installation of extensions with pdo prefix 2019-10-19 19:29:29 +05:30
Shivam Mathur
8d9a12ba84 PHP7.4 RC4 on windows and macOS 2019-10-19 11:09:31 +05:30
Shivam Mathur
76e0150bb5 Update FUNDING.yml 2019-10-19 10:29:42 +05:30
Shivam Mathur
ffc5b0249d Merge pull request #60 from shivammathur/develop
Release 1.4.3
2019-10-17 22:12:11 +05:30
Shivam Mathur
a6aaa1db78 Improve Logs and tests 2019-10-17 21:39:01 +05:30
47 changed files with 993 additions and 607 deletions

3
.github/FUNDING.yml vendored
View File

@@ -1,5 +1,8 @@
# These are supported funding model platforms
github: shivammathur
community_bridge: setup-php
issuehunt: shivammathur
patreon: shivammathur
liberapay: shivammathur
custom: https://www.paypal.me/shivammathur

View File

@@ -16,20 +16,23 @@ jobs:
with:
fetch-depth: 1
- name: Setup Node.js 10.x
- name: Setup Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 10.x
node-version: 12.x
- name: Installing NPM packages
run: npm install
- name: Run tests and send coverage
run: |
npm test
curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
- name: Run tests
run: npm test
- name: Installing PHP with extensions and custom config
- name: Send Coverage
continue-on-error: true
timeout-minutes: 2
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
- name: Setup PHP with extensions and custom config
run: node lib/install.js
env:
php-version: ${{ matrix.php-versions }}
@@ -44,6 +47,6 @@ jobs:
run: php -m
- name: Testing ini values
run: |
php -r "echo \"post_max_size: \" . ini_get('post_max_size') . \"\n\";"
php -r "echo \"short_open_tag: \" . ini_get('short_open_tag') . \"\n\";"
php -r "echo \"date.timezone: \" . ini_get('date.timezone') . \"\n\";"
printf "post_max_size: %s\n" $(php -r "echo ini_get('post_max_size');")
printf "short_open_tag: %s\n" $(php -r "echo ini_get('short_open_tag');")
printf "date.timezone: %s\n" $(php -r "echo ini_get('date.timezone');")

View File

@@ -26,7 +26,7 @@ Setup PHP with required extensions, php.ini configuration and composer in [GitHu
|7.1|`Stable`|`Security fixes only`|
|7.2|`Stable`|`Active`|
|7.3|`Stable`|`Active`|
|7.4|`RC3`|`Active`|
|7.4|`RC4`|`Active`|
**Note:** PHP 7.4 is currently in development, do not use in production/release branches.
@@ -108,7 +108,7 @@ See [action.yml](action.yml "Metadata for this GitHub Action") and usage below f
steps:
- name: Checkout
uses: actions/checkout@master
- name: Installing PHP
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: '7.3'
@@ -138,7 +138,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install PHP
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
@@ -186,7 +186,7 @@ Contributions are welcome! See [Contributor's Guide](.github/CONTRIBUTING.md "sh
## :sparkling_heart: Support this project
- Please star the project and share it.
- Consider supporting on <a href="https://www.patreon.com/shivammathur"><img alt="Support me on Patreon" src="https://shivammathur.com/badges/patreon.svg"></a> and <a href="https://www.paypal.me/shivammathur"><img alt="Support me on Paypal" src="https://shivammathur.com/badges/paypal.svg"></a>.
- Please support on <a href="https://www.patreon.com/shivammathur"><img alt="Support me on Patreon" src="https://shivammathur.com/badges/patreon.svg"></a> and <a href="https://www.paypal.me/shivammathur"><img alt="Support me on Paypal" src="https://shivammathur.com/badges/paypal.svg"></a>.
## :bookmark: This action uses the following works

View File

@@ -20,10 +20,11 @@ describe('Config tests', () => {
it('checking addINIValuesOnLinux', async () => {
let linux: string = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'linux'
'linux',
true
);
expect(linux).toContain(
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" >> $ini_file'
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
);
linux = await config.addINIValues(
@@ -39,7 +40,7 @@ describe('Config tests', () => {
'darwin'
);
expect(darwin).toContain(
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" >> $ini_file'
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
);
darwin = await config.addINIValues(

View File

@@ -17,10 +17,10 @@ describe('Config tests', () => {
);
win32 = await coverage.addCoverage('pcov', '7.0', 'win32');
expect(win32).toContain('PCOV requires PHP 7.1 or newer');
expect(win32).toContain('PHP 7.1 or newer is required');
win32 = await coverage.addCoverage('pcov', '5.6', 'win32');
expect(win32).toContain('PCOV requires PHP 7.1 or newer');
expect(win32).toContain('PHP 7.1 or newer is required');
});
it('checking addCoverage with PCOV on linux', async () => {

View File

@@ -19,9 +19,14 @@ describe('Extension tests', () => {
);
expect(win32).toContain('Install-PhpExtension pcov');
win32 = await extensions.addExtension('does_not_exist', '7.2', 'win32');
win32 = await extensions.addExtension(
'does_not_exist',
'7.2',
'win32',
true
);
expect(win32).toContain(
'Add-Extension does_not_exist "Install-PhpExtension does_not_exist" extension "Add Extension"'
'Add-Extension does_not_exist "Install-PhpExtension does_not_exist" extension'
);
win32 = await extensions.addExtension('xdebug', '7.2', 'fedora');
@@ -35,23 +40,23 @@ describe('Extension tests', () => {
'linux'
);
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt install -y php7.2-xdebug'
'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php7.2-xdebug'
);
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt install -y php7.2-pcov'
'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php7.2-pcov'
);
linux = await extensions.addExtension('xdebug, pcov', '7.4', 'linux');
expect(linux).toContain('./xdebug.sh');
expect(linux).toContain('./pcov.sh');
expect(linux).toContain('xdebug.sh');
expect(linux).toContain('pcov.sh');
linux = await extensions.addExtension('phalcon3, phalcon4', '7.2', 'linux');
expect(linux).toContain('./phalcon.sh master 7.2');
expect(linux).toContain('./phalcon.sh 4.0.x 7.2');
expect(linux).toContain('phalcon.sh master 7.2');
expect(linux).toContain('phalcon.sh 4.0.x 7.2');
linux = await extensions.addExtension('phalcon3, phalcon4', '7.3', 'linux');
expect(linux).toContain('./phalcon.sh master 7.3');
expect(linux).toContain('./phalcon.sh 4.0.x 7.3');
expect(linux).toContain('phalcon.sh master 7.3');
expect(linux).toContain('phalcon.sh 4.0.x 7.3');
linux = await extensions.addExtension('xdebug', '7.2', 'fedora');
expect(linux).toContain('Platform fedora is not supported');
@@ -76,15 +81,20 @@ describe('Extension tests', () => {
expect(darwin).toContain('sudo pecl install xdebug-2.5.5');
darwin = await extensions.addExtension('xdebug', '7.4', 'darwin');
expect(darwin).toContain('sh ./xdebug_darwin.sh');
expect(darwin).toContain('xdebug_darwin.sh');
darwin = await extensions.addExtension('pcov', '7.4', 'darwin');
expect(darwin).toContain('sh ./pcov.sh');
expect(darwin).toContain('pcov.sh');
darwin = await extensions.addExtension('xdebug', '7.2', 'darwin');
expect(darwin).toContain('sudo pecl install xdebug');
darwin = await extensions.addExtension('does_not_exist', '7.2', 'darwin');
darwin = await extensions.addExtension(
'does_not_exist',
'7.2',
'darwin',
false
);
expect(darwin).toContain('add_extension does_not_exist');
darwin = await extensions.addExtension('xdebug', '7.2', 'fedora');

View File

@@ -65,14 +65,13 @@ describe('Utils tests', () => {
it('checking writeScripts', async () => {
let testString: string = 'sudo apt-get install php';
await utils.writeScript('test.sh', '10', testString);
await fs.readFile(path.join(__dirname, '../10test.sh'), function(
error: any,
data: Buffer
) {
let runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
let script_path: string = path.join(runner_dir, 'test.sh');
await utils.writeScript('test.sh', testString);
await fs.readFile(script_path, function(error: any, data: Buffer) {
expect(testString).toBe(data.toString());
});
await cleanup('./10test.sh');
await cleanup(script_path);
});
it('checking extensionArray', async () => {
@@ -101,53 +100,48 @@ describe('Utils tests', () => {
let message: string = 'Test message';
let warning_log: string = await utils.log(message, 'win32', 'warning');
expect(warning_log).toEqual(
"Write-Host '" + message + "' -ForegroundColor yellow"
);
expect(warning_log).toEqual('printf "\\033[33;1m' + message + ' \\033[0m"');
warning_log = await utils.log(message, 'linux', 'warning');
expect(warning_log).toEqual('echo "\\033[33;1m' + message + '\\033[0m"');
warning_log = await utils.log(message, 'darwin', 'warning');
expect(warning_log).toEqual('echo "\\033[33;1m' + message + '\\033[0m"');
let error_log: string = await utils.log(message, 'win32', 'error');
expect(error_log).toEqual(
"Write-Host '" + message + "' -ForegroundColor red"
);
expect(error_log).toEqual('printf "\\033[31;1m' + message + ' \\033[0m"');
error_log = await utils.log(message, 'linux', 'error');
expect(error_log).toEqual('echo "\\033[31;1m' + message + '\\033[0m"');
error_log = await utils.log(message, 'darwin', 'error');
expect(error_log).toEqual('echo "\\033[31;1m' + message + '\\033[0m"');
let success_log: string = await utils.log(message, 'win32', 'success');
expect(success_log).toEqual(
"Write-Host '" + message + "' -ForegroundColor green"
);
expect(success_log).toEqual('printf "\\033[32;1m' + message + ' \\033[0m"');
success_log = await utils.log(message, 'linux', 'success');
expect(success_log).toEqual('echo "\\033[32;1m' + message + '\\033[0m"');
success_log = await utils.log(message, 'darwin', 'success');
expect(success_log).toEqual('echo "\\033[32;1m' + message + '\\033[0m"');
success_log = await utils.log(message, 'win32', 'success', 'Test win');
expect(success_log).toEqual(
"Write-Host 'Test win: " + message + "' -ForegroundColor green"
);
});
let step_log: string = await utils.stepLog(message, 'win32');
expect(step_log).toEqual('Step-Log "Test message"');
step_log = await utils.stepLog(message, 'linux');
expect(step_log).toEqual('step_log "Test message"');
step_log = await utils.stepLog(message, 'darwin');
expect(step_log).toEqual('step_log "Test message"');
step_log = await utils.stepLog(message, 'fedora');
expect(step_log).toContain('Platform fedora is not supported');
it('checking log with prefix', async () => {
let message: string = 'Test message';
let prefix_log: string = await utils.log(
message,
'linux',
'success',
'Test Prefix'
);
expect(prefix_log).toEqual(
'echo "\\033[32;1mTest Prefix: ' + message + '\\033[0m"'
);
prefix_log = await utils.log(message, 'darwin', 'success', 'Test');
expect(prefix_log).toEqual(
'echo "\\033[32;1mTest: ' + message + '\\033[0m"'
let add_log: string = await utils.addLog(
'tick',
'xdebug',
'enabled',
'win32'
);
expect(add_log).toEqual('Add-Log "tick" "xdebug" "enabled"');
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'linux');
expect(add_log).toEqual('add_log "tick" "xdebug" "enabled"');
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'darwin');
expect(add_log).toEqual('add_log "tick" "xdebug" "enabled"');
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'fedora');
expect(add_log).toContain('Platform fedora is not supported');
});
it('checking getExtensionPrefix', async () => {
@@ -158,4 +152,13 @@ describe('Utils tests', () => {
expect(await utils.getExtensionPrefix('xdebug')).toEqual('zend_extension');
expect(await utils.getExtensionPrefix('opcache')).toEqual('zend_extension');
});
it('checking suppressOutput', async () => {
expect(await utils.suppressOutput('win32')).toEqual(' >$null 2>&1');
expect(await utils.suppressOutput('linux')).toEqual(' >/dev/null 2>&1');
expect(await utils.suppressOutput('darwin')).toEqual(' >/dev/null 2>&1');
expect(await utils.suppressOutput('fedora')).toContain(
'Platform fedora is not supported'
);
});
});

View File

@@ -2,7 +2,6 @@ name: 'Setup PHP Action'
author: shivammathur
description: 'GitHub action to setup PHP with required extensions, php.ini configuration, code-coverage support and composer'
branding:
icon: 'activity'
color: 'purple'
inputs:
php-version:

View File

@@ -21,5 +21,4 @@ jobs:
- name: Install dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
shell: pwsh
run: vendor/bin/phpunit --coverage-text

View File

@@ -29,5 +29,4 @@ jobs:
- name: Clear Config
run: php artisan config:clear
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
shell: pwsh
run: vendor/bin/phpunit --coverage-text

View File

@@ -25,5 +25,4 @@ jobs:
- name: Prepare the application
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
shell: pwsh
run: vendor/bin/phpunit --coverage-text

View File

@@ -21,5 +21,4 @@ jobs:
- name: Install dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
shell: pwsh
run: vendor/bin/phpunit --coverage-text

View File

@@ -23,5 +23,4 @@ jobs:
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
shell: pwsh
run: vendor/bin/phpunit --coverage-text

View File

@@ -23,16 +23,29 @@ const utils = __importStar(require("./utils"));
* @param ini_values_csv
* @param os_version
*/
function addINIValues(ini_values_csv, os_version) {
function addINIValues(ini_values_csv, os_version, no_step = false) {
return __awaiter(this, void 0, void 0, function* () {
let script = '\n';
switch (no_step) {
case true:
script +=
(yield utils.stepLog('Add php.ini values', os_version)) +
(yield utils.suppressOutput(os_version)) +
'\n';
break;
case false:
default:
script += (yield utils.stepLog('Add php.ini values', os_version)) + '\n';
break;
}
switch (os_version) {
case 'win32':
return yield addINIValuesWindows(ini_values_csv);
return script + (yield addINIValuesWindows(ini_values_csv));
case 'darwin':
case 'linux':
return yield addINIValuesUnix(ini_values_csv);
return script + (yield addINIValuesUnix(ini_values_csv));
default:
return yield utils.log('Platform ' + os_version + ' is not supported', os_version, 'error', 'Add Config');
return yield utils.log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
});
}
@@ -45,7 +58,14 @@ exports.addINIValues = addINIValues;
function addINIValuesUnix(ini_values_csv) {
return __awaiter(this, void 0, void 0, function* () {
let ini_values = yield utils.INIArray(ini_values_csv);
return '\necho "' + ini_values.join('\n') + '" >> $ini_file\n';
let script = '\n';
yield utils.asyncForEach(ini_values, function (line) {
return __awaiter(this, void 0, void 0, function* () {
script +=
(yield utils.addLog('$tick', line, 'Added to php.ini', 'linux')) + '\n';
});
});
return 'echo "' + ini_values.join('\n') + '" >> $ini_file' + script;
});
}
exports.addINIValuesUnix = addINIValuesUnix;
@@ -57,7 +77,17 @@ exports.addINIValuesUnix = addINIValuesUnix;
function addINIValuesWindows(ini_values_csv) {
return __awaiter(this, void 0, void 0, function* () {
let ini_values = yield utils.INIArray(ini_values_csv);
return ('Add-Content C:\\tools\\php\\php.ini "' + ini_values.join('\n') + '"\n');
let script = '\n';
yield utils.asyncForEach(ini_values, function (line) {
return __awaiter(this, void 0, void 0, function* () {
script +=
(yield utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n';
});
});
return ('Add-Content C:\\tools\\php\\php.ini "' +
ini_values.join('\n') +
'"' +
script);
});
}
exports.addINIValuesWindows = addINIValuesWindows;

View File

@@ -29,13 +29,14 @@ const config = __importStar(require("./config"));
function addCoverage(coverage_driver, version, os_version) {
return __awaiter(this, void 0, void 0, function* () {
coverage_driver.toLowerCase();
let script = '\n' + (yield utils.stepLog('Setup Coverage', os_version));
switch (coverage_driver) {
case 'pcov':
return addCoveragePCOV(version, os_version);
return script + (yield addCoveragePCOV(version, os_version));
case 'xdebug':
return addCoverageXdebug(version, os_version);
return script + (yield addCoverageXdebug(version, os_version));
case 'none':
return disableCoverage(version, os_version);
return script + (yield disableCoverage(version, os_version));
default:
return '';
}
@@ -50,10 +51,10 @@ exports.addCoverage = addCoverage;
*/
function addCoverageXdebug(version, os_version) {
return __awaiter(this, void 0, void 0, function* () {
let script = '\n';
script += yield extensions.addExtension('xdebug', version, os_version, 'Set Coverage Driver');
script += yield utils.log('Xdebug enabled as coverage driver', os_version, 'success', 'Set Coverage Driver');
return script;
return ((yield extensions.addExtension('xdebug', version, os_version, true)) +
(yield utils.suppressOutput(os_version)) +
'\n' +
(yield utils.addLog('$tick', 'xdebug', 'Xdebug enabled as coverage driver', os_version)));
});
}
exports.addCoverageXdebug = addCoverageXdebug;
@@ -68,8 +69,12 @@ function addCoveragePCOV(version, os_version) {
let script = '\n';
switch (version) {
default:
script += yield extensions.addExtension('pcov', version, os_version, 'Set Coverage Driver');
script += yield config.addINIValues('pcov.enabled=1', os_version);
script +=
(yield extensions.addExtension('pcov', version, os_version, true)) +
(yield utils.suppressOutput(os_version)) +
'\n';
script +=
(yield config.addINIValues('pcov.enabled=1', os_version, true)) + '\n';
// add command to disable xdebug and enable pcov
switch (os_version) {
case 'linux':
@@ -90,12 +95,12 @@ function addCoveragePCOV(version, os_version) {
break;
}
// success
script += yield utils.log('PCOV enabled as coverage driver', os_version, 'success', 'Set Coverage Driver');
script += yield utils.addLog('$tick', 'coverage: pcov', 'PCOV enabled as coverage driver', os_version);
// version is not supported
break;
case '5.6':
case '7.0':
script += yield utils.log('PCOV requires PHP 7.1 or newer', os_version, 'warning', 'Set Coverage Driver');
script += yield utils.addLog('$cross', 'pcov', 'PHP 7.1 or newer is required', os_version);
break;
}
return script;
@@ -139,7 +144,7 @@ function disableCoverage(version, os_version) {
'if(php -m | findstr -i pcov) { Disable-PhpExtension pcov C:\\tools\\php }\n';
break;
}
script += yield utils.log('Disabled Xdebug and PCOV', os_version, 'success', 'Set Coverage Driver');
script += yield utils.addLog('$tick', 'none', 'Disabled Xdebug and PCOV', os_version);
return script;
});
}

View File

@@ -16,6 +16,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
const utils = __importStar(require("./utils"));
/**
* Install and enable extensions
@@ -25,17 +26,29 @@ const utils = __importStar(require("./utils"));
* @param os_version
* @param log_prefix
*/
function addExtension(extension_csv, version, os_version, log_prefix = 'Add Extension') {
function addExtension(extension_csv, version, os_version, no_step = false) {
return __awaiter(this, void 0, void 0, function* () {
let script = '\n';
switch (no_step) {
case true:
script +=
(yield utils.stepLog('Setup Extensions', os_version)) +
(yield utils.suppressOutput(os_version));
break;
case false:
default:
script += yield utils.stepLog('Setup Extensions', os_version);
break;
}
switch (os_version) {
case 'win32':
return yield addExtensionWindows(extension_csv, version, log_prefix);
return script + (yield addExtensionWindows(extension_csv, version));
case 'darwin':
return yield addExtensionDarwin(extension_csv, version, log_prefix);
return script + (yield addExtensionDarwin(extension_csv, version));
case 'linux':
return yield addExtensionLinux(extension_csv, version, log_prefix);
return script + (yield addExtensionLinux(extension_csv, version));
default:
return yield utils.log('Platform ' + os_version + ' is not supported', os_version, 'error', log_prefix);
return yield utils.log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
});
}
@@ -46,7 +59,7 @@ exports.addExtension = addExtension;
* @param extension_csv
* @param version
*/
function addExtensionDarwin(extension_csv, version, log_prefix) {
function addExtensionDarwin(extension_csv, version) {
return __awaiter(this, void 0, void 0, function* () {
let extensions = yield utils.extensionArray(extension_csv);
let script = '\n';
@@ -58,11 +71,15 @@ function addExtensionDarwin(extension_csv, version, log_prefix) {
switch (version + extension) {
case '7.4xdebug':
install_command =
'sh ./xdebug_darwin.sh >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/xdebug_darwin.sh') +
' >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
break;
case '7.4pcov':
install_command =
'sh ./pcov.sh >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/pcov.sh') +
' >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
break;
case '5.6xdebug':
install_command = 'sudo pecl install xdebug-2.5.5 >/dev/null 2>&1';
@@ -72,15 +89,12 @@ function addExtensionDarwin(extension_csv, version, log_prefix) {
break;
}
script +=
'add_extension ' +
'\nadd_extension ' +
extension +
' "' +
install_command +
'" ' +
(yield utils.getExtensionPrefix(extension)) +
' "' +
log_prefix +
'"\n';
(yield utils.getExtensionPrefix(extension));
});
});
return script;
@@ -93,7 +107,7 @@ exports.addExtensionDarwin = addExtensionDarwin;
* @param extension_csv
* @param version
*/
function addExtensionWindows(extension_csv, version, log_prefix) {
function addExtensionWindows(extension_csv, version) {
return __awaiter(this, void 0, void 0, function* () {
let extensions = yield utils.extensionArray(extension_csv);
let script = '\n';
@@ -117,15 +131,12 @@ function addExtensionWindows(extension_csv, version, log_prefix) {
break;
}
script +=
'Add-Extension ' +
'\nAdd-Extension ' +
extension +
' "' +
install_command +
'" ' +
(yield utils.getExtensionPrefix(extension)) +
' "' +
log_prefix +
'"\n';
(yield utils.getExtensionPrefix(extension));
});
});
return script;
@@ -138,7 +149,7 @@ exports.addExtensionWindows = addExtensionWindows;
* @param extension_csv
* @param version
*/
function addExtensionLinux(extension_csv, version, log_prefix) {
function addExtensionLinux(extension_csv, version) {
return __awaiter(this, void 0, void 0, function* () {
let extensions = yield utils.extensionArray(extension_csv);
let script = '\n';
@@ -150,23 +161,38 @@ function addExtensionLinux(extension_csv, version, log_prefix) {
switch (version + extension) {
case '7.4xdebug':
install_command =
'./xdebug.sh >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/xdebug.sh') +
' >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
break;
case '7.4pcov':
install_command =
'./pcov.sh >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/pcov.sh') +
' >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
break;
case '7.2phalcon3':
case '7.3phalcon3':
install_command = './phalcon.sh master ' + version + ' >/dev/null 2>&1';
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' master ' +
version +
' >/dev/null 2>&1';
break;
case '7.2phalcon4':
case '7.3phalcon4':
install_command = './phalcon.sh 4.0.x ' + version + ' >/dev/null 2>&1';
case '7.4phalcon4':
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' 4.0.x ' +
version +
' >/dev/null 2>&1';
break;
default:
install_command =
'sudo DEBIAN_FRONTEND=noninteractive apt install -y php' +
'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php' +
version +
'-' +
extension +
@@ -174,15 +200,12 @@ function addExtensionLinux(extension_csv, version, log_prefix) {
break;
}
script +=
'add_extension ' +
'\nadd_extension ' +
extension +
' "' +
install_command +
'" ' +
(yield utils.getExtensionPrefix(extension)) +
' "' +
log_prefix +
'"\n';
(yield utils.getExtensionPrefix(extension));
});
});
return script;

View File

@@ -18,50 +18,60 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const exec_1 = require("@actions/exec/lib/exec");
const core = __importStar(require("@actions/core"));
const utils = __importStar(require("./utils"));
const extensions = __importStar(require("./extensions"));
const config = __importStar(require("./config"));
const coverage = __importStar(require("./coverage"));
const extensions = __importStar(require("./extensions"));
const utils = __importStar(require("./utils"));
/**
* Build the script
*
* @param filename
* @param version
* @param os_version
*/
function build(filename, version, os_version) {
return __awaiter(this, void 0, void 0, function* () {
// taking inputs
let extension_csv = yield utils.getInput('extension-csv', false);
let ini_values_csv = yield utils.getInput('ini-values-csv', false);
let coverage_driver = yield utils.getInput('coverage', false);
let script = yield utils.readScript(filename, version, os_version);
if (extension_csv) {
script += yield extensions.addExtension(extension_csv, version, os_version);
}
if (ini_values_csv) {
script += yield config.addINIValues(ini_values_csv, os_version);
}
if (coverage_driver) {
script += yield coverage.addCoverage(coverage_driver, version, os_version);
}
return yield utils.writeScript(filename, script);
});
}
/**
* Run the script
*/
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
// taking inputs
let version = yield utils.getInput('php-version', true);
let extension_csv = yield utils.getInput('extension-csv', false);
let ini_values_csv = yield utils.getInput('ini-values-csv', false);
let coverage_driver = yield utils.getInput('coverage', false);
let os_version = process.platform;
let version = yield utils.getInput('php-version', true);
// check the os version and run the respective script
if (os_version == 'darwin') {
let darwin = yield utils.readScript('darwin.sh', version, os_version);
darwin += yield extensions.addExtension(extension_csv, version, os_version);
darwin += yield config.addINIValues(ini_values_csv, os_version);
darwin += yield coverage.addCoverage(coverage_driver, version, os_version);
yield utils.writeScript('darwin.sh', version, darwin);
yield exec_1.exec('sh ./' + version + 'darwin.sh ' + version);
let script_path = yield build('darwin.sh', version, os_version);
yield exec_1.exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
}
else if (os_version == 'win32') {
let windows = yield utils.readScript('win32.ps1', version, os_version);
windows += yield extensions.addExtension(extension_csv, version, os_version);
windows += yield config.addINIValues(ini_values_csv, os_version);
windows += yield coverage.addCoverage(coverage_driver, version, os_version);
yield utils.writeScript('win32.ps1', version, windows);
yield exec_1.exec('powershell .\\' + version + 'win32.ps1 -version ' + version);
let script_path = yield build('win32.ps1', version, os_version);
yield exec_1.exec('pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname);
}
else if (os_version == 'linux') {
let linux = yield utils.readScript('linux.sh', version, os_version);
linux += yield extensions.addExtension(extension_csv, version, os_version);
linux += yield config.addINIValues(ini_values_csv, os_version);
linux += yield coverage.addCoverage(coverage_driver, version, os_version);
yield utils.writeScript('linux.sh', version, linux);
yield exec_1.exec('./' + version + 'linux.sh ' + version);
let script_path = yield build('linux.sh', version, os_version);
yield exec_1.exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
}
}
catch (err) {
core.setFailed(err.message);
catch (error) {
core.setFailed(error.message);
}
});
}

View File

@@ -53,19 +53,6 @@ function asyncForEach(array, callback) {
});
}
exports.asyncForEach = asyncForEach;
/**
* Copy config
*
* @param files
*/
function readFiles74(files) {
return __awaiter(this, void 0, void 0, function* () {
yield asyncForEach(files, function (filename) {
fs.createReadStream(path.join(__dirname, '../src/' + filename)).pipe(fs.createWriteStream(filename.split('/')[1], { mode: 0o755 }));
});
});
}
exports.readFiles74 = readFiles74;
/**
* Read the scripts
*
@@ -79,35 +66,15 @@ function readScript(filename, version, os_version) {
case 'darwin':
switch (version) {
case '7.4':
yield readFiles74([
'configs/config.yaml',
'scripts/xdebug_darwin.sh',
'scripts/pcov.sh'
]);
return fs.readFileSync(path.join(__dirname, '../src/scripts/7.4.sh'), 'utf8');
}
break;
return fs.readFileSync(path.join(__dirname, '../src/scripts/' + filename), 'utf8');
case 'linux':
let files = ['scripts/phalcon.sh'];
yield readFiles74(['scripts/phalcon.sh']);
switch (version) {
case '7.4':
files.concat(['scripts/xdebug.sh', 'scripts/pcov.sh']);
break;
}
yield readFiles74(files);
break;
case 'win32':
switch (version) {
case '7.4':
yield readFiles74(['ext/php_pcov.dll']);
break;
}
break;
return fs.readFileSync(path.join(__dirname, '../src/scripts/' + filename), 'utf8');
default:
return yield log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
return fs.readFileSync(path.join(__dirname, '../src/scripts/' + filename), 'utf8');
});
}
exports.readScript = readScript;
@@ -118,9 +85,12 @@ exports.readScript = readScript;
* @param version
* @param script
*/
function writeScript(filename, version, script) {
function writeScript(filename, script) {
return __awaiter(this, void 0, void 0, function* () {
fs.writeFileSync(version + filename, script, { mode: 0o755 });
let runner_dir = yield getInput('RUNNER_TOOL_CACHE', false);
let script_path = path.join(runner_dir, filename);
fs.writeFileSync(script_path, script, { mode: 0o755 });
return script_path;
});
}
exports.writeScript = writeScript;
@@ -140,7 +110,9 @@ function extensionArray(extension_csv) {
return extension
.trim()
.replace('php-', '')
.replace('php_', '');
.replace('php_', '')
.replace('pdo_', '')
.replace('pdo-', '');
});
}
});
@@ -166,42 +138,68 @@ function INIArray(ini_values_csv) {
});
}
exports.INIArray = INIArray;
function log(message, os_version, log_type, prefix = '') {
/**
* Function to log a step
*
* @param message
* @param os_version
*/
function stepLog(message, os_version) {
return __awaiter(this, void 0, void 0, function* () {
const unix_color = {
switch (os_version) {
case 'win32':
return 'Step-Log "' + message + '"';
case 'linux':
case 'darwin':
return 'step_log "' + message + '"';
default:
return yield log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
});
}
exports.stepLog = stepLog;
/**
* Function to log a result
* @param mark
* @param subject
* @param message
*/
function addLog(mark, subject, message, os_version) {
return __awaiter(this, void 0, void 0, function* () {
switch (os_version) {
case 'win32':
return 'Add-Log "' + mark + '" "' + subject + '" "' + message + '"';
case 'linux':
case 'darwin':
return 'add_log "' + mark + '" "' + subject + '" "' + message + '"';
default:
return yield log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
});
}
exports.addLog = addLog;
/**
* Log to console
*
* @param message
* @param os_version
* @param log_type
* @param prefix
*/
function log(message, os_version, log_type) {
return __awaiter(this, void 0, void 0, function* () {
const color = {
error: '31',
success: '32',
warning: '33'
};
switch (prefix) {
case '':
prefix = '';
break;
default:
prefix = prefix + ': ';
break;
}
switch (os_version) {
case 'win32':
const color = {
error: 'red',
success: 'green',
warning: 'yellow'
};
return ("Write-Host '" +
prefix +
message +
"' -ForegroundColor " +
color[log_type]);
return ('printf "\\033[' + color[log_type] + ';1m' + message + ' \\033[0m"');
case 'linux':
case 'darwin':
default:
return ('echo "\\033[' +
unix_color[log_type] +
';1m' +
prefix +
message +
'\\033[0m"');
return 'echo "\\033[' + color[log_type] + ';1m' + message + '\\033[0m"';
}
});
}
@@ -225,3 +223,22 @@ function getExtensionPrefix(extension) {
});
}
exports.getExtensionPrefix = getExtensionPrefix;
/**
* Function to get the suffix to suppress console output
*
* @param os_version
*/
function suppressOutput(os_version) {
return __awaiter(this, void 0, void 0, function* () {
switch (os_version) {
case 'win32':
return ' >$null 2>&1';
case 'linux':
case 'darwin':
return ' >/dev/null 2>&1';
default:
return yield log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
});
}
exports.suppressOutput = suppressOutput;

33
node_modules/@actions/core/README.md generated vendored
View File

@@ -104,4 +104,37 @@ const result = await core.group('Do something async', async () => {
const response = await doSomeHTTPRequest()
return response
})
```
#### Action state
You can use this library to save state and get state for sharing information between a given wrapper action:
**action.yml**
```yaml
name: 'Wrapper action sample'
inputs:
name:
default: 'GitHub'
runs:
using: 'node12'
main: 'main.js'
post: 'cleanup.js'
```
In action's `main.js`:
```js
const core = require('@actions/core');
core.saveState("pidToKill", 12345);
```
In action's `cleanup.js`:
```js
const core = require('@actions/core');
var pid = core.getState("pidToKill");
process.kill(pid);
```

View File

@@ -96,3 +96,17 @@ export declare function endGroup(): void;
* @param fn The function to wrap in the group
*/
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
/**
* Saves state for current action, the state can only be retrieved by this action's post job execution.
*
* @param name name of the state to store
* @param value value to store
*/
export declare function saveState(name: string, value: string): void;
/**
* Gets the value of an state set by this action's main execution.
*
* @param name name of the state to get
* @returns string
*/
export declare function getState(name: string): string;

View File

@@ -169,4 +169,27 @@ function group(name, fn) {
});
}
exports.group = group;
//-----------------------------------------------------------------------
// Wrapper action state
//-----------------------------------------------------------------------
/**
* Saves state for current action, the state can only be retrieved by this action's post job execution.
*
* @param name name of the state to store
* @param value value to store
*/
function saveState(name, value) {
command_1.issueCommand('save-state', { name }, value);
}
exports.saveState = saveState;
/**
* Gets the value of an state set by this action's main execution.
*
* @param name name of the state to get
* @returns string
*/
function getState(name) {
return process.env[`STATE_${name}`] || '';
}
exports.getState = getState;
//# sourceMappingURL=core.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"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"}
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"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"}

View File

@@ -1,34 +1,34 @@
{
"_args": [
[
"@actions/core@1.1.3",
"E:\\python\\setup-php"
"@actions/core@1.2.0",
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "@actions/core@1.1.3",
"_id": "@actions/core@1.1.3",
"_from": "@actions/core@1.2.0",
"_id": "@actions/core@1.2.0",
"_inBundle": false,
"_integrity": "sha512-2BIib53Jh4Cfm+1XNuZYYGTeRo8yiWEAUMoliMh1qQGMaqTF4VUlhhcsBylTu4qWmUx45DrY0y0XskimAHSqhw==",
"_integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==",
"_location": "/@actions/core",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@actions/core@1.1.3",
"raw": "@actions/core@1.2.0",
"name": "@actions/core",
"escapedName": "@actions%2fcore",
"scope": "@actions",
"rawSpec": "1.1.3",
"rawSpec": "1.2.0",
"saveSpec": null,
"fetchSpec": "1.1.3"
"fetchSpec": "1.2.0"
},
"_requiredBy": [
"/",
"/@actions/tool-cache"
],
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.1.3.tgz",
"_spec": "1.1.3",
"_where": "E:\\python\\setup-php",
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz",
"_spec": "1.2.0",
"_where": "C:\\wamp64\\www\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
@@ -64,5 +64,5 @@
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.1.3"
"version": "1.2.0"
}

View File

@@ -2,7 +2,7 @@
"_args": [
[
"@actions/exec@1.0.1",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "@actions/exec@1.0.1",
@@ -27,7 +27,7 @@
],
"_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.1.tgz",
"_spec": "1.0.1",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},

View File

@@ -2,7 +2,7 @@
"_args": [
[
"@actions/io@1.0.1",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "@actions/io@1.0.1",
@@ -27,7 +27,7 @@
],
"_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz",
"_spec": "1.0.1",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},

View File

@@ -2,7 +2,7 @@
"_args": [
[
"@actions/tool-cache@1.1.2",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "@actions/tool-cache@1.1.2",
@@ -27,7 +27,7 @@
],
"_resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.1.2.tgz",
"_spec": "1.1.2",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},

4
node_modules/fs/package.json generated vendored
View File

@@ -2,7 +2,7 @@
"_args": [
[
"fs@0.0.1-security",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "fs@0.0.1-security",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"_spec": "0.0.1-security",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"author": "",
"bugs": {
"url": "https://github.com/npm/security-holder/issues"

8
node_modules/semver/package.json generated vendored
View File

@@ -2,7 +2,7 @@
"_args": [
[
"semver@6.3.0",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "semver@6.3.0",
@@ -23,12 +23,14 @@
},
"_requiredBy": [
"/@actions/tool-cache",
"/eslint-plugin-compat",
"/istanbul-lib-instrument",
"/jest-snapshot"
"/jest-snapshot",
"/node-releases"
],
"_resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"_spec": "6.3.0",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"bin": {
"semver": "./bin/semver.js"
},

4
node_modules/tunnel/package.json generated vendored
View File

@@ -2,7 +2,7 @@
"_args": [
[
"tunnel@0.0.4",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "tunnel@0.0.4",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz",
"_spec": "0.0.4",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"author": {
"name": "Koichi Kobayashi",
"email": "koichik@improvement.jp"

View File

@@ -2,7 +2,7 @@
"_args": [
[
"typed-rest-client@1.5.0",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "typed-rest-client@1.5.0",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.5.0.tgz",
"_spec": "1.5.0",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"author": {
"name": "Microsoft Corporation"
},

View File

@@ -2,7 +2,7 @@
"_args": [
[
"underscore@1.8.3",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "underscore@1.8.3",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz",
"_spec": "1.8.3",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"author": {
"name": "Jeremy Ashkenas",
"email": "jeremy@documentcloud.org"

4
node_modules/uuid/package.json generated vendored
View File

@@ -2,7 +2,7 @@
"_args": [
[
"uuid@3.3.3",
"E:\\python\\setup-php"
"C:\\wamp64\\www\\setup-php"
]
],
"_from": "uuid@3.3.3",
@@ -27,7 +27,7 @@
],
"_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"_spec": "3.3.3",
"_where": "E:\\python\\setup-php",
"_where": "C:\\wamp64\\www\\setup-php",
"bin": {
"uuid": "./bin/uuid"
},

179
package-lock.json generated
View File

@@ -1,13 +1,13 @@
{
"name": "setup-php",
"version": "1.4.2",
"version": "1.4.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.1.3.tgz",
"integrity": "sha512-2BIib53Jh4Cfm+1XNuZYYGTeRo8yiWEAUMoliMh1qQGMaqTF4VUlhhcsBylTu4qWmUx45DrY0y0XskimAHSqhw=="
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz",
"integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw=="
},
"@actions/exec": {
"version": "1.0.1",
@@ -184,6 +184,15 @@
"@babel/helper-plugin-utils": "^7.0.0"
}
},
"@babel/runtime": {
"version": "7.6.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.3.tgz",
"integrity": "sha512-kq6anf9JGjW8Nt5rYfEuGRaEAaH1mkv3Bbu6rYvLOpPh/RusSJXuKPEAoZ7L7gybZkchE8+NV5g9vKF4AGAtsA==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.2"
}
},
"@babel/template": {
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz",
@@ -525,9 +534,9 @@
}
},
"@types/jest": {
"version": "24.0.18",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.18.tgz",
"integrity": "sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ==",
"version": "24.0.20",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.20.tgz",
"integrity": "sha512-M8ebEkOpykGdLoRrmew7UowTZ1DANeeP0HiSIChl/4DGgmnSC1ntitNtkyNSXjMTsZvXuaxJrxjImEnRWNPsPw==",
"dev": true,
"requires": {
"@types/jest-diff": "*"
@@ -540,9 +549,9 @@
"dev": true
},
"@types/node": {
"version": "12.7.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.12.tgz",
"integrity": "sha512-KPYGmfD0/b1eXurQ59fXD1GBzhSQfz6/lKBxkaHX9dKTzjXbK68Zt7yGUxUsCS1jeTy/8aL+d9JEr+S54mpkWQ==",
"version": "12.11.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.7.tgz",
"integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==",
"dev": true
},
"@types/normalize-package-data": {
@@ -711,6 +720,12 @@
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
"dev": true
},
"ast-metadata-inferer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.1.1.tgz",
"integrity": "sha512-hc9w8Qrgg9Lf9iFcZVhNjUnhrd2BBpTlyCnegPVvCe6O0yMrF57a6Cmh7k+xUsfUOMh9wajOL5AsGOBNEyTCcw==",
"dev": true
},
"astral-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
@@ -933,6 +948,17 @@
}
}
},
"browserslist": {
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.2.tgz",
"integrity": "sha512-uZavT/gZXJd2UTi9Ov7/Z340WOSQ3+m1iBVRUknf+okKxonL9P83S3ctiBDtuRmRu8PiCHjqyueqQ9HYlJhxiw==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001004",
"electron-to-chromium": "^1.3.295",
"node-releases": "^1.1.38"
}
},
"bs-logger": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",
@@ -943,9 +969,9 @@
}
},
"bser": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/bser/-/bser-2.1.0.tgz",
"integrity": "sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg==",
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz",
"integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==",
"dev": true,
"requires": {
"node-int64": "^0.4.0"
@@ -1004,6 +1030,18 @@
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dev": true
},
"caniuse-db": {
"version": "1.0.30001005",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001005.tgz",
"integrity": "sha512-MSRfm2N6FRDSpAJ00ipCuFe0CNink5JJOFzl4S7fLSBJdowhGq3uMxzkWGTjvvReo1PuWfK5YYJydJJ+9mJebw==",
"dev": true
},
"caniuse-lite": {
"version": "1.0.30001005",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001005.tgz",
"integrity": "sha512-g78miZm1Z5njjYR216a5812oPiLgV1ssndgGxITHWUopmjUrCswMisA0a2kSB7a0vZRox6JOKhM51+efmYN8Mg==",
"dev": true
},
"capture-exit": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
@@ -1111,9 +1149,9 @@
}
},
"commander": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true,
"optional": true
},
@@ -1219,9 +1257,9 @@
},
"dependencies": {
"whatwg-url": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz",
"integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==",
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz",
"integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==",
"dev": true,
"requires": {
"lodash.sortby": "^4.7.0",
@@ -1345,6 +1383,12 @@
"safer-buffer": "^2.1.0"
}
},
"electron-to-chromium": {
"version": "1.3.296",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.296.tgz",
"integrity": "sha512-s5hv+TSJSVRsxH190De66YHb50pBGTweT9XGWYu/LMR20KX6TsjFzObo36CjVAzM+PUeeKSBRtm/mISlCzeojQ==",
"dev": true
},
"emoji-regex": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
@@ -1370,9 +1414,9 @@
}
},
"es-abstract": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.15.0.tgz",
"integrity": "sha512-bhkEqWJ2t2lMeaJDuk7okMkJWI/yqgH/EoGwpcvv0XW9RWQsRspI4wt6xuyuvMvvQE3gg/D9HXppgk21w78GyQ==",
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.0.tgz",
"integrity": "sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.0",
@@ -1425,6 +1469,21 @@
}
}
},
"eslint-plugin-compat": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-compat/-/eslint-plugin-compat-3.3.0.tgz",
"integrity": "sha512-QCgYy3pZ+zH10dkBJus1xER0359h1UhJjufhQRqp9Owm6BEoLZeSqxf2zINwL1OGao9Yc96xPYIW3nQj5HUryg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.4.5",
"ast-metadata-inferer": "^0.1.1",
"browserslist": "^4.6.3",
"caniuse-db": "^1.0.30000977",
"lodash.memoize": "4.1.2",
"mdn-browser-compat-data": "^0.0.84",
"semver": "^6.1.2"
}
},
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
@@ -1739,8 +1798,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
@@ -2155,8 +2213,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -2212,7 +2269,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -2256,14 +2312,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
@@ -2310,9 +2364,9 @@
}
},
"glob": {
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
"version": "7.1.5",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz",
"integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
@@ -2330,9 +2384,9 @@
"dev": true
},
"graceful-fs": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz",
"integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
"dev": true
},
"growly": {
@@ -2342,11 +2396,12 @@
"dev": true
},
"handlebars": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.3.tgz",
"integrity": "sha512-B0W4A2U1ww3q7VVthTKfh+epHx+q4mCt6iK+zEAzbMBpWQAwxCeKxEGpj/1oQTpzPXDNSOG7hmG14TsISH50yw==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.0.tgz",
"integrity": "sha512-yss1ZbupTpRfe86dpM1abxnnSfxa6eIRn3laqBPIgRYy87qgYtX6xinSOeybjYo/4AVzdTTWK5Kr06A6AllxJg==",
"dev": true,
"requires": {
"eslint-plugin-compat": "^3.3.0",
"neo-async": "^2.6.0",
"optimist": "^0.6.1",
"source-map": "^0.6.1",
@@ -3552,6 +3607,15 @@
"object-visit": "^1.0.0"
}
},
"mdn-browser-compat-data": {
"version": "0.0.84",
"resolved": "https://registry.npmjs.org/mdn-browser-compat-data/-/mdn-browser-compat-data-0.0.84.tgz",
"integrity": "sha512-fAznuGNaQMQiWLVf+gyp33FaABTglYWqMT7JqvH+4RZn2UQPD12gbMqxwP9m0lj8AAbNpu5/kD6n4Ox1SOffpw==",
"dev": true,
"requires": {
"extend": "3.0.2"
}
},
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -3730,6 +3794,15 @@
}
}
},
"node-releases": {
"version": "1.1.39",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.39.tgz",
"integrity": "sha512-8MRC/ErwNCHOlAFycy9OPca46fQYUjbJRDcZTHVWIGXIjYLM73k70vv3WkYutVnM4cCo4hE0MqBVVZjP6vjISA==",
"dev": true,
"requires": {
"semver": "^6.3.0"
}
},
"normalize-package-data": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
@@ -4150,9 +4223,9 @@
"dev": true
},
"react-is": {
"version": "16.10.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.10.2.tgz",
"integrity": "sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA==",
"version": "16.11.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz",
"integrity": "sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw==",
"dev": true
},
"read-pkg": {
@@ -4213,6 +4286,12 @@
"util.promisify": "^1.0.0"
}
},
"regenerator-runtime": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
"integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==",
"dev": true
},
"regex-not": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
@@ -4632,9 +4711,9 @@
}
},
"source-map-support": {
"version": "0.5.13",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
"version": "0.5.15",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.15.tgz",
"integrity": "sha512-wYF5aX1J0+V51BDT3Om7uXNn0ct2FWiV4bvwiGVefxkm+1S1o5jsecE5lb2U28DDblzxzxeIDbTVpXHI9D/9hA==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
@@ -5021,13 +5100,13 @@
"dev": true
},
"uglify-js": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.1.tgz",
"integrity": "sha512-+dSJLJpXBb6oMHP+Yvw8hUgElz4gLTh82XuX68QiJVTXaE5ibl6buzhNkQdYhBlIhozWOC9ge16wyRmjG4TwVQ==",
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.4.tgz",
"integrity": "sha512-9Yc2i881pF4BPGhjteCXQNaXx1DCwm3dtOyBaG2hitHjLWOczw/ki8vD1bqyT3u6K0Ms/FpCShkmfg+FtlOfYA==",
"dev": true,
"optional": true,
"requires": {
"commander": "2.20.0",
"commander": "~2.20.3",
"source-map": "~0.6.1"
}
},

View File

@@ -1,8 +1,8 @@
{
"name": "setup-php",
"version": "1.4.2",
"version": "1.4.5",
"private": false,
"description": "Setup php action",
"description": "Setup PHP for use with GitHub Actions",
"main": "lib/setup-php.js",
"scripts": {
"build": "tsc",

View File

@@ -6,19 +6,35 @@ import * as utils from './utils';
* @param ini_values_csv
* @param os_version
*/
export async function addINIValues(ini_values_csv: string, os_version: string) {
export async function addINIValues(
ini_values_csv: string,
os_version: string,
no_step = false
): Promise<string> {
let script: string = '\n';
switch (no_step) {
case true:
script +=
(await utils.stepLog('Add php.ini values', os_version)) +
(await utils.suppressOutput(os_version)) +
'\n';
break;
case false:
default:
script += (await utils.stepLog('Add php.ini values', os_version)) + '\n';
break;
}
switch (os_version) {
case 'win32':
return await addINIValuesWindows(ini_values_csv);
return script + (await addINIValuesWindows(ini_values_csv));
case 'darwin':
case 'linux':
return await addINIValuesUnix(ini_values_csv);
return script + (await addINIValuesUnix(ini_values_csv));
default:
return await utils.log(
'Platform ' + os_version + ' is not supported',
os_version,
'error',
'Add Config'
'error'
);
}
}
@@ -32,7 +48,12 @@ export async function addINIValuesUnix(
ini_values_csv: string
): Promise<string> {
let ini_values: Array<string> = await utils.INIArray(ini_values_csv);
return '\necho "' + ini_values.join('\n') + '" >> $ini_file\n';
let script: string = '\n';
await utils.asyncForEach(ini_values, async function(line: string) {
script +=
(await utils.addLog('$tick', line, 'Added to php.ini', 'linux')) + '\n';
});
return 'echo "' + ini_values.join('\n') + '" >> $ini_file' + script;
}
/**
@@ -44,7 +65,15 @@ export async function addINIValuesWindows(
ini_values_csv: string
): Promise<string> {
let ini_values: Array<string> = await utils.INIArray(ini_values_csv);
let script: string = '\n';
await utils.asyncForEach(ini_values, async function(line: string) {
script +=
(await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n';
});
return (
'Add-Content C:\\tools\\php\\php.ini "' + ini_values.join('\n') + '"\n'
'Add-Content C:\\tools\\php\\php.ini "' +
ini_values.join('\n') +
'"' +
script
);
}

View File

@@ -15,13 +15,15 @@ export async function addCoverage(
os_version: string
): Promise<string> {
coverage_driver.toLowerCase();
let script: string =
'\n' + (await utils.stepLog('Setup Coverage', os_version));
switch (coverage_driver) {
case 'pcov':
return addCoveragePCOV(version, os_version);
return script + (await addCoveragePCOV(version, os_version));
case 'xdebug':
return addCoverageXdebug(version, os_version);
return script + (await addCoverageXdebug(version, os_version));
case 'none':
return disableCoverage(version, os_version);
return script + (await disableCoverage(version, os_version));
default:
return '';
}
@@ -34,21 +36,17 @@ export async function addCoverage(
* @param os_version
*/
export async function addCoverageXdebug(version: string, os_version: string) {
let script: string = '\n';
script += await extensions.addExtension(
'xdebug',
version,
os_version,
'Set Coverage Driver'
return (
(await extensions.addExtension('xdebug', version, os_version, true)) +
(await utils.suppressOutput(os_version)) +
'\n' +
(await utils.addLog(
'$tick',
'xdebug',
'Xdebug enabled as coverage driver',
os_version
))
);
script += await utils.log(
'Xdebug enabled as coverage driver',
os_version,
'success',
'Set Coverage Driver'
);
return script;
}
/**
@@ -61,13 +59,12 @@ export async function addCoveragePCOV(version: string, os_version: string) {
let script: string = '\n';
switch (version) {
default:
script += await extensions.addExtension(
'pcov',
version,
os_version,
'Set Coverage Driver'
);
script += await config.addINIValues('pcov.enabled=1', os_version);
script +=
(await extensions.addExtension('pcov', version, os_version, true)) +
(await utils.suppressOutput(os_version)) +
'\n';
script +=
(await config.addINIValues('pcov.enabled=1', os_version, true)) + '\n';
// add command to disable xdebug and enable pcov
switch (os_version) {
@@ -90,21 +87,21 @@ export async function addCoveragePCOV(version: string, os_version: string) {
}
// success
script += await utils.log(
script += await utils.addLog(
'$tick',
'coverage: pcov',
'PCOV enabled as coverage driver',
os_version,
'success',
'Set Coverage Driver'
os_version
);
// version is not supported
break;
case '5.6':
case '7.0':
script += await utils.log(
'PCOV requires PHP 7.1 or newer',
os_version,
'warning',
'Set Coverage Driver'
script += await utils.addLog(
'$cross',
'pcov',
'PHP 7.1 or newer is required',
os_version
);
break;
}
@@ -148,11 +145,11 @@ export async function disableCoverage(version: string, os_version: string) {
'if(php -m | findstr -i pcov) { Disable-PhpExtension pcov C:\\tools\\php }\n';
break;
}
script += await utils.log(
script += await utils.addLog(
'$tick',
'none',
'Disabled Xdebug and PCOV',
os_version,
'success',
'Set Coverage Driver'
os_version
);
return script;

View File

@@ -1,3 +1,4 @@
import * as path from 'path';
import * as utils from './utils';
/**
@@ -12,21 +13,33 @@ export async function addExtension(
extension_csv: string,
version: string,
os_version: string,
log_prefix = 'Add Extension'
no_step = false
): Promise<string> {
let script: string = '\n';
switch (no_step) {
case true:
script +=
(await utils.stepLog('Setup Extensions', os_version)) +
(await utils.suppressOutput(os_version));
break;
case false:
default:
script += await utils.stepLog('Setup Extensions', os_version);
break;
}
switch (os_version) {
case 'win32':
return await addExtensionWindows(extension_csv, version, log_prefix);
return script + (await addExtensionWindows(extension_csv, version));
case 'darwin':
return await addExtensionDarwin(extension_csv, version, log_prefix);
return script + (await addExtensionDarwin(extension_csv, version));
case 'linux':
return await addExtensionLinux(extension_csv, version, log_prefix);
return script + (await addExtensionLinux(extension_csv, version));
default:
return await utils.log(
'Platform ' + os_version + ' is not supported',
os_version,
'error',
log_prefix
'error'
);
}
}
@@ -39,8 +52,7 @@ export async function addExtension(
*/
export async function addExtensionDarwin(
extension_csv: string,
version: string,
log_prefix: string
version: string
): Promise<string> {
let extensions: Array<string> = await utils.extensionArray(extension_csv);
let script: string = '\n';
@@ -51,11 +63,15 @@ export async function addExtensionDarwin(
switch (version + extension) {
case '7.4xdebug':
install_command =
'sh ./xdebug_darwin.sh >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/xdebug_darwin.sh') +
' >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
break;
case '7.4pcov':
install_command =
'sh ./pcov.sh >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/pcov.sh') +
' >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
break;
case '5.6xdebug':
install_command = 'sudo pecl install xdebug-2.5.5 >/dev/null 2>&1';
@@ -65,15 +81,12 @@ export async function addExtensionDarwin(
break;
}
script +=
'add_extension ' +
'\nadd_extension ' +
extension +
' "' +
install_command +
'" ' +
(await utils.getExtensionPrefix(extension)) +
' "' +
log_prefix +
'"\n';
(await utils.getExtensionPrefix(extension));
});
return script;
}
@@ -86,8 +99,7 @@ export async function addExtensionDarwin(
*/
export async function addExtensionWindows(
extension_csv: string,
version: string,
log_prefix: string
version: string
): Promise<string> {
let extensions: Array<string> = await utils.extensionArray(extension_csv);
let script: string = '\n';
@@ -112,15 +124,12 @@ export async function addExtensionWindows(
break;
}
script +=
'Add-Extension ' +
'\nAdd-Extension ' +
extension +
' "' +
install_command +
'" ' +
(await utils.getExtensionPrefix(extension)) +
' "' +
log_prefix +
'"\n';
(await utils.getExtensionPrefix(extension));
});
return script;
}
@@ -133,8 +142,7 @@ export async function addExtensionWindows(
*/
export async function addExtensionLinux(
extension_csv: string,
version: string,
log_prefix: string
version: string
): Promise<string> {
let extensions: Array<string> = await utils.extensionArray(extension_csv);
let script: string = '\n';
@@ -146,23 +154,38 @@ export async function addExtensionLinux(
switch (version + extension) {
case '7.4xdebug':
install_command =
'./xdebug.sh >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/xdebug.sh') +
' >/dev/null 2>&1 && echo "zend_extension=xdebug.so" >> $ini_file';
break;
case '7.4pcov':
install_command =
'./pcov.sh >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
'sh ' +
path.join(__dirname, '../src/scripts/pcov.sh') +
' >/dev/null 2>&1 && echo "extension=pcov.so" >> $ini_file';
break;
case '7.2phalcon3':
case '7.3phalcon3':
install_command = './phalcon.sh master ' + version + ' >/dev/null 2>&1';
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' master ' +
version +
' >/dev/null 2>&1';
break;
case '7.2phalcon4':
case '7.3phalcon4':
install_command = './phalcon.sh 4.0.x ' + version + ' >/dev/null 2>&1';
case '7.4phalcon4':
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') +
' 4.0.x ' +
version +
' >/dev/null 2>&1';
break;
default:
install_command =
'sudo DEBIAN_FRONTEND=noninteractive apt install -y php' +
'sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php' +
version +
'-' +
extension +
@@ -170,15 +193,12 @@ export async function addExtensionLinux(
break;
}
script +=
'add_extension ' +
'\nadd_extension ' +
extension +
' "' +
install_command +
'" ' +
(await utils.getExtensionPrefix(extension)) +
' "' +
log_prefix +
'"\n';
(await utils.getExtensionPrefix(extension));
});
return script;
}

View File

@@ -1,80 +1,64 @@
import {exec} from '@actions/exec/lib/exec';
import * as core from '@actions/core';
import * as utils from './utils';
import * as extensions from './extensions';
import * as path from 'path';
import * as config from './config';
import * as coverage from './coverage';
import * as extensions from './extensions';
import * as utils from './utils';
/**
* Build the script
*
* @param filename
* @param version
* @param os_version
*/
async function build(
filename: string,
version: string,
os_version: string
): Promise<string> {
// taking inputs
let extension_csv: string = await utils.getInput('extension-csv', false);
let ini_values_csv: string = await utils.getInput('ini-values-csv', false);
let coverage_driver: string = await utils.getInput('coverage', false);
let script: string = await utils.readScript(filename, version, os_version);
if (extension_csv) {
script += await extensions.addExtension(extension_csv, version, os_version);
}
if (ini_values_csv) {
script += await config.addINIValues(ini_values_csv, os_version);
}
if (coverage_driver) {
script += await coverage.addCoverage(coverage_driver, version, os_version);
}
return await utils.writeScript(filename, script);
}
/**
* Run the script
*/
async function run() {
try {
// taking inputs
let version: string = await utils.getInput('php-version', true);
let extension_csv: string = await utils.getInput('extension-csv', false);
let ini_values_csv: string = await utils.getInput('ini-values-csv', false);
let coverage_driver: string = await utils.getInput('coverage', false);
let os_version: string = process.platform;
let version: string = await utils.getInput('php-version', true);
// check the os version and run the respective script
if (os_version == 'darwin') {
let darwin: string = await utils.readScript(
'darwin.sh',
version,
os_version
);
darwin += await extensions.addExtension(
extension_csv,
version,
os_version
);
darwin += await config.addINIValues(ini_values_csv, os_version);
darwin += await coverage.addCoverage(
coverage_driver,
version,
os_version
);
await utils.writeScript('darwin.sh', version, darwin);
await exec('sh ./' + version + 'darwin.sh ' + version);
let script_path: string = await build('darwin.sh', version, os_version);
await exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
} else if (os_version == 'win32') {
let windows: string = await utils.readScript(
'win32.ps1',
version,
os_version
let script_path: string = await build('win32.ps1', version, os_version);
await exec(
'pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname
);
windows += await extensions.addExtension(
extension_csv,
version,
os_version
);
windows += await config.addINIValues(ini_values_csv, os_version);
windows += await coverage.addCoverage(
coverage_driver,
version,
os_version
);
await utils.writeScript('win32.ps1', version, windows);
await exec('powershell .\\' + version + 'win32.ps1 -version ' + version);
} else if (os_version == 'linux') {
let linux: string = await utils.readScript(
'linux.sh',
version,
os_version
);
linux += await extensions.addExtension(
extension_csv,
version,
os_version
);
linux += await config.addINIValues(ini_values_csv, os_version);
linux += await coverage.addCoverage(coverage_driver, version, os_version);
await utils.writeScript('linux.sh', version, linux);
await exec('./' + version + 'linux.sh ' + version);
let script_path: string = await build('linux.sh', version, os_version);
await exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
}
} catch (err) {
core.setFailed(err.message);
} catch (error) {
core.setFailed(error.message);
}
}

View File

@@ -1,5 +1,28 @@
version='7.4.0RC3'
brew install pkg-config autoconf bison re2c openssl@1.1 krb5 enchant libffi freetype intltool icu4c libiconv t1lib gd libzip gmp tidyp libxml2 libxslt postgresql curl >/dev/null 2>&1
tick="✓"
cross="✗"
step_log() {
message=$1
printf "\n\033[90;1m==> \033[0m\033[37;1m%s\033[0m\n" "$message"
}
add_log() {
mark=$1
subject=$2
message=$3
if [ "$mark" = "$tick" ]; then
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
else
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
fi
}
version='7.4.0RC4'
step_log "Setup dependencies"
for package in pkg-config autoconf bison re2c openssl@1.1 krb5 enchant libffi freetype intltool icu4c libiconv t1lib gd libzip gmp tidyp libxml2 libxslt postgresql curl;
do
brew install "$package" >/dev/null 2>&1
add_log "$tick" "$package" "Installed"
done
brew link icu4c gettext --force >/dev/null 2>&1
for package in gettext gmp krb5 icu4c bison openssl@1.1 libxml2 libffi libxslt libiconv pkgconfig enchant krb5 readline libedit freetype;
@@ -35,7 +58,9 @@ echo 'export EXTRA_LIBS="/usr/local/opt/readline/lib/libhistory.dylib
/usr/local/opt/icu4c/lib/libicutu.dylib
/usr/local/opt/icu4c/lib/libicuuc.dylib"'
} >> ~/.bash_profile
config_file=$(pwd)/config.yaml
config_file=$2/../src/configs/config.yaml
step_log "Setup PHPBrew"
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew >/dev/null 2>&1
chmod +x ./phpbrew
sudo mv phpbrew /usr/local/bin/phpbrew
@@ -47,37 +72,43 @@ sudo chmod -R 777 /opt/phpbrew
export PHPBREW_ROOT=/opt/phpbrew
export PHPBREW_HOME=/opt/phpbrew
echo "[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc" >> ~/.bashrc
add_log "$tick" "PHPBrew" "Installed"
source ~/.bash_profile >/dev/null 2>&1
source ~/.bashrc >/dev/null 2>&1
step_log "Setup PHP and Composer"
phpbrew install -j 6 $version +dev >/dev/null 2>&1
phpbrew switch $version
sudo ln -sf /opt/phpbrew/php/php-$version/bin/* /usr/local/bin/
sudo ln -sf /opt/phpbrew/php/php-$version/etc/php.ini /etc/php.ini
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ext_dir=$(php -i | grep "extension_dir => /opt" | sed -e "s|.*=> s*||")
pecl config-set php_ini "$ini_file"
pecl config-set php_ini "$ini_file" >/dev/null 2>&1
sudo chmod 777 "$ini_file"
brew install composer
brew install composer >/dev/null 2>&1
add_extension()
{
add_log "$tick" "PHP" "Installed PHP$version"
add_log "$tick" "Composer" "Installed"
add_extension() {
extension=$1
install_command=$2
prefix=$3
log_prefix=$4
if ! php -m | grep -i -q "$extension" && [ -e "$ext_dir/$extension.so" ]; then
echo "$prefix=$extension" >> "$ini_file" && echo "\033[32;1m$log_prefix: Enabled $extension\033[0m";
echo "$prefix=$extension" >>"$ini_file" && add_log "$tick" "$extension" "Enabled"
elif php -m | grep -i -q "$extension"; then
echo "\033[33;1m$log_prefix: $extension was already enabled\033[0m";
add_log "$tick" "$extension" "Enabled"
elif ! php -m | grep -i -q "$extension"; then
exists=$(curl -sL https://pecl.php.net/json.php?package="$extension" -w "%{http_code}" -o /dev/null)
if [ "$exists" = "200" ]; then
eval "$install_command" && \
echo "\033[32;1m$log_prefix: Installed and enabled $extension\033[0m" || \
echo "\033[31;1m$log_prefix: Could not install $extension on PHP$version\033[0m";
(
eval "$install_command" && \
add_log "$tick" "$extension" "Installed and enabled"
) || add_log "$cross" "$extension" "Could not install $extension on PHP$version"
else
if ! php -m | grep -i -q "$extension"; then
echo "\033[31;1m$log_prefix: Could not find $extension for PHP$version on PECL\033[0m";
add_log "$cross" "$extension" "Could not find $extension for PHP$version on PECL"
fi
fi
fi

View File

@@ -1,37 +1,57 @@
tick="✓"
cross="✗"
step_log() {
message=$1
printf "\n\033[90;1m==> \033[0m\033[37;1m%s\033[0m\n" "$message"
}
add_log() {
mark=$1
subject=$2
message=$3
if [ "$mark" = "$tick" ]; then
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
else
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
fi
}
version=$1
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
if [ "$1" = "5.6" ] || [ "$1" = "7.0" ]; then
brew tap exolnet/homebrew-deprecated >/dev/null 2>&1
fi
step_log "Setup PHP and Composer"
brew install php@"$1" composer >/dev/null 2>&1
brew link --force --overwrite php@"$1" >/dev/null 2>&1
ini_file=$(php --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")
echo "date.timezone=UTC" >> "$ini_file"
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
sudo chmod 777 "$ini_file"
mkdir -p "$(pecl config-get ext_dir)"
composer global require hirak/prestissimo >/dev/null 2>&1
php -v
composer -V
add_log "$tick" "PHP" "Installed PHP$version"
add_log "$tick" "Composer" "Installed"
add_extension()
{
add_extension() {
extension=$1
install_command=$2
prefix=$3
log_prefix=$4
if ! php -m | grep -i -q "$extension" && [ -e "$ext_dir/$extension.so" ]; then
echo "$prefix=$extension" >> "$ini_file" && echo "\033[32;1m$log_prefix: Enabled $extension\033[0m";
echo "$prefix=$extension" >>"$ini_file" && add_log $tick "$extension" "Enabled"
elif php -m | grep -i -q "$extension"; then
echo "\033[33;1m$log_prefix: $extension was already enabled\033[0m";
add_log "$tick" "$extension" "Enabled"
elif ! php -m | grep -i -q "$extension"; then
exists=$(curl -sL https://pecl.php.net/json.php?package="$extension" -w "%{http_code}" -o /dev/null)
if [ "$exists" = "200" ]; then
eval "$install_command" && \
echo "\033[32;1m$log_prefix: Installed and enabled $extension\033[0m" || \
echo "\033[31;1m$log_prefix: Could not install $extension on PHP$version\033[0m";
(
eval "$install_command" && \
add_log "$tick" "$extension" "Installed and enabled"
) || add_log "$cross" "$extension" "Could not install $extension on PHP$version"
else
if ! php -m | grep -i -q "$extension"; then
echo "\033[31;1m$log_prefix: Could not find $extension for PHP$version on PECL\033[0m";
add_log "$cross" "$extension" "Could not find $extension for PHP$version on PECL"
fi
fi
fi

View File

@@ -1,21 +1,49 @@
tick="✓"
cross="✗"
step_log() {
message=$1
printf "\n\033[90;1m==> \033[0m\033[37;1m%s\033[0m\n" "$message"
}
add_log() {
mark=$1
subject=$2
message=$3
if [ "$mark" = "$tick" ]; then
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
else
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
fi
}
existing_version=$(php-config --version | cut -c 1-3)
version=$1
status="Switched to PHP$version"
step_log "Setup PHP and Composer"
if [ "$existing_version" != "$1" ]; then
if [ ! -e "/usr/bin/php$1" ]; then
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1
sudo DEBIAN_FRONTEND=noninteractive apt update -y >/dev/null 2>&1
if [ "$1" != "7.4" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
else
sudo DEBIAN_FRONTEND=noninteractive apt install -y php"$1" php"$1"-dev curl php"$1"-curl >/dev/null 2>&1
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1" php"$1"-dev curl php"$1"-curl >/dev/null 2>&1
fi
status="Installed PHP$version"
fi
for tool in php phar phar.phar php-cgi php-config phpize; do
if [ -e "/usr/bin/$tool$1" ]; then
sudo update-alternatives --set $tool /usr/bin/"$tool$1" &
sudo update-alternatives --set $tool /usr/bin/"$tool$1" >/dev/null 2>&1
fi
done
fi
fi
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
sudo chmod 777 "$ini_file"
sudo mkdir -p /run/php
add_log "$tick" "PHP" "$status"
if [ ! -e "/usr/bin/composer" ]; then
curl -s -L https://getcomposer.org/installer > composer-setup.php
@@ -27,28 +55,22 @@ if [ ! -e "/usr/bin/composer" ]; then
fi
rm composer-setup.php
fi
composer global require hirak/prestissimo >/dev/null 2>&1
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
sudo chmod 777 "$ini_file"
sudo mkdir -p /run/php
php -v
composer -V
add_log "$tick" "Composer" "Installed"
add_extension()
{
extension=$1
install_command=$2
prefix=$3
log_prefix=$4
if ! php -m | grep -i -q "$extension" && [ -e "$ext_dir/$extension.so" ]; then
echo "$prefix=$extension" >> "$ini_file" && echo "\033[32;1m$log_prefix: Enabled $extension\033[0m";
echo "$prefix=$extension" >> "$ini_file" && add_log "$tick" "$extension" "Enabled"
elif php -m | grep -i -q "$extension"; then
echo "\033[33;1m$log_prefix: $extension was already enabled\033[0m";
add_log "$tick" "$extension" "Enabled"
elif ! php -m | grep -i -q "$extension"; then
eval "$install_command" && \
echo "\033[32;1m$log_prefix: Installed and enabled $extension\033[0m" || \
echo "\033[31;1m$log_prefix: Could not find php$version-$extension on APT repository\033[0m";
(
eval "$install_command" && \
add_log "$tick" "$extension" "Installed and enabled"
) || add_log "$cross" "$extension" "Could not find php$version-$extension"
fi
}
}

View File

@@ -1,7 +1,5 @@
git clone --depth=1 https://github.com/krakjoe/pcov.git
(
cd ~ && git clone --depth=1 https://github.com/krakjoe/pcov.git
cd pcov && phpize
./configure --enable-pcov
make
sudo make install
)
sudo make install

View File

@@ -1,19 +1,21 @@
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
sudo DEBIAN_FRONTEND=noninteractive apt install php"$2"-dev php-pear -y
sudo DEBIAN_FRONTEND=noninteractive apt install php"$2"-dev -y
for tool in php-config phpize; do
if [ -e "/usr/bin/$tool$2" ]; then
sudo update-alternatives --set $tool /usr/bin/"$tool$2" &
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
fi
done
sudo pecl config-set php_ini "$ini_file"
sudo pear config-set php_ini "$ini_file"
sudo pecl install psr
cd ~ && git clone --depth=1 https://github.com/jbboehr/php-psr.git
cd php-psr && sudo /usr/bin/phpize"$2"
./configure --with-php-config=/usr/bin/php-config"$2"
make -j2 && sudo make -j2 install
echo "extension=psr.so" >> "$ini_file"
if [ "$1" = "master" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt install php"$2"-phalcon -y
else
git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
(
cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
echo "extension=phalcon.so" >> "$ini_file"
)
cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
echo "extension=phalcon.so" >> "$ini_file"
fi

View File

@@ -1,59 +1,66 @@
param (
[Parameter(Mandatory=$true)][string]$version = "7.3"
[Parameter(Mandatory=$true)][string]$version = "7.3",
[Parameter(Mandatory=$true)][string]$dir
)
$tick = ([char]8730)
$cross = ([char]10007)
Function Step-Log($message) {
printf "\n\033[90;1m==> \033[0m\033[37;1m%s \033[0m\n" $message
}
Function Add-Log($mark, $subject, $message) {
$code = if($mark -eq $cross) {"31"} else {"32"}
printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $code $mark $subject $message
}
if($version -eq '7.4') {
$version = '7.4RC'
}
Write-Host "Installing PhpManager" -ForegroundColor Blue
Step-Log "Setup PhpManager"
Install-Module -Name PhpManager -Force -Scope CurrentUser
Add-Log $tick "PhpManager" "Installed"
$installed = $($(php -v)[0] -join '')[4..6] -join ''
Step-Log "Setup PHP and Composer"
$status = "Switched to PHP$version"
if($installed -ne $version) {
if($version -lt '7.0') {
Write-Host "Installing VcRedist"
Install-Module -Name VcRedist -Force
}
Write-Host "Installing PHP" -ForegroundColor Blue
Uninstall-Php C:\tools\php
Install-Php -Version $version -Architecture x86 -ThreadSafe $true -InstallVC -Path C:\tools\php$version -TimeZone UTC -InitialPhpIni Production -Force
Write-Host "Switch PHP" -ForegroundColor Blue
(Get-PhpSwitcher).targets
Initialize-PhpSwitcher -Alias C:\tools\php -Scope CurrentUser -Force
Add-PhpToSwitcher -Name $version -Path C:\tools\php$version -Force
Switch-Php $version -Force
Install-Php -Version $version -Architecture x86 -ThreadSafe $true -InstallVC -Path C:\tools\php -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1
$status = "Installed PHP$version"
}
Write-Host "Housekeeping in PHP.ini, enabling openssl" -ForegroundColor Blue
$ext_dir = "C:\tools\php\ext"
Add-Content C:\tools\php\php.ini "date.timezone = 'UTC'"
Set-PhpIniKey extension_dir $ext_dir
if($version -lt '7.4') {
Enable-PhpExtension openssl
Enable-PhpExtension curl
} else {
Add-Content C:\tools\php\php.ini "extension=php_openssl.dll"
Copy-Item "php_pcov.dll" -Destination $ext_dir"\php_pcov.dll"
Add-Content C:\tools\php\php.ini "extension=php_openssl.dll`nextension=php_curl.dll"
Copy-Item $dir"\..\src\ext\php_pcov.dll" -Destination $ext_dir"\php_pcov.dll"
}
Add-Log $tick "PHP" $status
Write-Host "Installing Composer" -ForegroundColor Blue
Install-Composer -Scope System -Path C:\tools\php
php -v
composer -V
Add-Log $tick "Composer" "Installed"
Function Add-Extension($extension, $install_command, $prefix, $log_prefix)
Function Add-Extension($extension, $install_command, $prefix)
{
try {
$exist = Test-Path -Path C:\tools\php\ext\php_$extension.dll
if(!(php -m | findstr -i ${extension}) -and $exist) {
Add-Content C:\tools\php\php.ini "$prefix=php_$extension.dll"
Write-Host "$log_prefix`: Enabled $extension" -ForegroundColor green
Add-Log $tick $extension "Enabled"
} elseif(php -m | findstr -i $extension) {
Write-Host "$log_prefix`: $extension was already enabled" -ForegroundColor yellow
Add-Log $tick $extension "Enabled"
}
} catch [Exception] {
Write-Host "$log_prefix`: $extension could not be enabled" -ForegroundColor red
Add-Log $cross $extension "Could not enable"
}
$status = 404
@@ -67,14 +74,14 @@ Function Add-Extension($extension, $install_command, $prefix, $log_prefix)
if(!(php -m | findstr -i $extension)) {
try {
Invoke-Expression $install_command
Write-Host "$log_prefix`: Installed and enabled $extension" -ForegroundColor green
Add-Log $tick $extension "Installed and enabled"
} catch [Exception] {
Write-Host "$log_prefix`: Could not install $extension on PHP $version" -ForegroundColor red
Add-Log $cross $extension "Could not install on PHP$version"
}
}
} else {
if(!(php -m | findstr -i $extension)) {
Write-Host "$log_prefix`: Could not find $extension for PHP$version on PECL" -ForegroundColor red
Add-Log $cross $extension "Could not find $extension for PHP$version on PECL"
}
}
}

View File

@@ -1,5 +1,3 @@
git clone --depth=1 https://github.com/xdebug/xdebug.git
(
cd xdebug || echo "cd failed"
sudo ./rebuild.sh
)
cd ~ && git clone --depth=1 https://github.com/xdebug/xdebug.git
cd xdebug || echo "Failed to clone Xdebug"
sudo ./rebuild.sh

View File

@@ -1,8 +1,6 @@
git clone --depth=1 https://github.com/xdebug/xdebug.git
(
cd xdebug || echo "cd failed"
sudo phpize
sudo ./configure
sudo make
sudo cp modules/xdebug.so "$(php -i | grep "extension_dir => /opt" | sed -e "s|.*=> s*||")"
)
cd ~ && git clone --depth=1 https://github.com/xdebug/xdebug.git
cd xdebug || echo "Failed to clone Xdebug"
sudo phpize
sudo ./configure
sudo make
sudo cp modules/xdebug.so "$(php -i | grep "extension_dir => /opt" | sed -e "s|.*=> s*||")"

View File

@@ -38,19 +38,6 @@ export async function asyncForEach(
}
}
/**
* Copy config
*
* @param files
*/
export async function readFiles74(files: Array<string>) {
await asyncForEach(files, function(filename: string) {
fs.createReadStream(path.join(__dirname, '../src/' + filename)).pipe(
fs.createWriteStream(filename.split('/')[1], {mode: 0o755})
);
});
}
/**
* Read the scripts
*
@@ -67,34 +54,21 @@ export async function readScript(
case 'darwin':
switch (version) {
case '7.4':
await readFiles74([
'configs/config.yaml',
'scripts/xdebug_darwin.sh',
'scripts/pcov.sh'
]);
return fs.readFileSync(
path.join(__dirname, '../src/scripts/7.4.sh'),
'utf8'
);
}
break;
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
case 'linux':
let files: Array<string> = ['scripts/phalcon.sh'];
await readFiles74(['scripts/phalcon.sh']);
switch (version) {
case '7.4':
files.concat(['scripts/xdebug.sh', 'scripts/pcov.sh']);
break;
}
await readFiles74(files);
break;
case 'win32':
switch (version) {
case '7.4':
await readFiles74(['ext/php_pcov.dll']);
break;
}
break;
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
default:
return await log(
'Platform ' + os_version + ' is not supported',
@@ -102,11 +76,6 @@ export async function readScript(
'error'
);
}
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
}
/**
@@ -118,10 +87,12 @@ export async function readScript(
*/
export async function writeScript(
filename: string,
version: string,
script: string
): Promise<any> {
fs.writeFileSync(version + filename, script, {mode: 0o755});
): Promise<string> {
let runner_dir: string = await getInput('RUNNER_TOOL_CACHE', false);
let script_path: string = path.join(runner_dir, filename);
fs.writeFileSync(script_path, script, {mode: 0o755});
return script_path;
}
/**
@@ -141,7 +112,9 @@ export async function extensionArray(
return extension
.trim()
.replace('php-', '')
.replace('php_', '');
.replace('php_', '')
.replace('pdo_', '')
.replace('pdo-', '');
});
}
}
@@ -164,51 +137,87 @@ export async function INIArray(ini_values_csv: string): Promise<Array<string>> {
}
}
/**
* Function to log a step
*
* @param message
* @param os_version
*/
export async function stepLog(
message: string,
os_version: string
): Promise<string> {
switch (os_version) {
case 'win32':
return 'Step-Log "' + message + '"';
case 'linux':
case 'darwin':
return 'step_log "' + message + '"';
default:
return await log(
'Platform ' + os_version + ' is not supported',
os_version,
'error'
);
}
}
/**
* Function to log a result
* @param mark
* @param subject
* @param message
*/
export async function addLog(
mark: string,
subject: string,
message: string,
os_version: string
): Promise<string> {
switch (os_version) {
case 'win32':
return 'Add-Log "' + mark + '" "' + subject + '" "' + message + '"';
case 'linux':
case 'darwin':
return 'add_log "' + mark + '" "' + subject + '" "' + message + '"';
default:
return await log(
'Platform ' + os_version + ' is not supported',
os_version,
'error'
);
}
}
/**
* Log to console
*
* @param message
* @param os_version
* @param log_type
* @param prefix
*/
export async function log(
message: string,
os_version: string,
log_type: string,
prefix = ''
log_type: string
): Promise<string> {
const unix_color: any = {
const color: any = {
error: '31',
success: '32',
warning: '33'
};
switch (prefix) {
case '':
prefix = '';
break;
default:
prefix = prefix + ': ';
break;
}
switch (os_version) {
case 'win32':
const color: any = {
error: 'red',
success: 'green',
warning: 'yellow'
};
return (
"Write-Host '" +
prefix +
message +
"' -ForegroundColor " +
color[log_type]
'printf "\\033[' + color[log_type] + ';1m' + message + ' \\033[0m"'
);
case 'linux':
case 'darwin':
default:
return (
'echo "\\033[' +
unix_color[log_type] +
';1m' +
prefix +
message +
'\\033[0m"'
);
return 'echo "\\033[' + color[log_type] + ';1m' + message + '\\033[0m"';
}
}
@@ -228,3 +237,24 @@ export async function getExtensionPrefix(extension: string): Promise<string> {
return 'extension';
}
}
/**
* Function to get the suffix to suppress console output
*
* @param os_version
*/
export async function suppressOutput(os_version: string): Promise<string> {
switch (os_version) {
case 'win32':
return ' >$null 2>&1';
case 'linux':
case 'darwin':
return ' >/dev/null 2>&1';
default:
return await log(
'Platform ' + os_version + ' is not supported',
os_version,
'error'
);
}
}