Add tools support

This commit is contained in:
Shivam Mathur
2019-12-27 06:56:49 +05:30
parent 273096b82f
commit de32d8b95f
13 changed files with 556 additions and 112 deletions

View File

@ -3,6 +3,7 @@ import * as core from '@actions/core';
import * as config from './config';
import * as coverage from './coverage';
import * as extensions from './extensions';
import * as tools from './tools';
import * as utils from './utils';
import * as matchers from './matchers';
@ -26,7 +27,11 @@ export async function build(
(await utils.getInput('ini-values', false)) ||
(await utils.getInput('ini-values-csv', false));
const coverage_driver: string = await utils.getInput('coverage', false);
const setup_matchers: string = await utils.getInput('matchers', false);
const pecl: string = await utils.getInput('pecl', false);
let tools_csv: string = await utils.getInput('tools', false);
if (pecl == 'true') {
tools_csv = 'pecl, ' + tools_csv;
}
let script: string = await utils.readScript(filename, version, os_version);
if (extension_csv) {
@ -38,6 +43,7 @@ export async function build(
if (coverage_driver) {
script += await coverage.addCoverage(coverage_driver, version, os_version);
}
script += await tools.addTools(tools_csv, os_version);
return await utils.writeScript(filename, script);
}
@ -54,15 +60,10 @@ export async function run(): Promise<void> {
let script_path = '';
switch (os_version) {
case 'darwin':
case 'linux':
script_path = await build(os_version + '.sh', version, os_version);
await exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
break;
case 'linux': {
const pecl: string = await utils.getInput('pecl', false);
script_path = await build(os_version + '.sh', version, os_version);
await exec('sh ' + script_path + ' ' + version + ' ' + pecl);
break;
}
case 'win32':
script_path = await build('win32.ps1', version, os_version);
await exec('pwsh ' + script_path + ' ' + version + ' ' + __dirname);