mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-09 12:26:24 +00:00
lint
This commit is contained in:
148
src/buildExec.ts
148
src/buildExec.ts
@@ -13,38 +13,38 @@ const isTrue = (variable) => {
|
||||
|
||||
const buildExec = () => {
|
||||
const clean = core.getInput('move_coverage_to_trash');
|
||||
const commit_parent = core.getInput('commit_parent');
|
||||
const curl_aws_args = core.getInput('aws_curl_args');
|
||||
const curl_codecov_args = core.getInput('codecov_curl_args');
|
||||
const env_vars = core.getInput('env_vars');
|
||||
const fail_ci = isTrue(core.getInput('fail_ci_if_error'));
|
||||
const commitParent = core.getInput('commit_parent');
|
||||
const curlAwsArgs = core.getInput('aws_curl_args');
|
||||
const curlCodecovArgs = core.getInput('codecov_curl_args');
|
||||
const envVars = core.getInput('env_vars');
|
||||
const failCi = isTrue(core.getInput('fail_ci_if_error'));
|
||||
const file = core.getInput('file');
|
||||
const files = core.getInput('files');
|
||||
const flags = core.getInput('flags');
|
||||
const functionalities = core.getInput('functionalities');
|
||||
const gcov_args = core.getInput('gcov_args');
|
||||
const gcov_dir = core.getInput('gcov_root_dir');
|
||||
const gcov_exclude = core.getInput('gcov_path_exclude');
|
||||
const gcov_exec = core.getInput('gcov_executable');
|
||||
const gcov_include = core.getInput('gcov_path_include');
|
||||
const gcov_prefix = core.getInput('gcov_prefix');
|
||||
const gcovArgs = core.getInput('gcov_args');
|
||||
const gcovDir = core.getInput('gcov_root_dir');
|
||||
const gcovExclude = core.getInput('gcov_path_exclude');
|
||||
const gcovExec = core.getInput('gcov_executable');
|
||||
const gcovInclude = core.getInput('gcov_path_include');
|
||||
const gcovPrefix = core.getInput('gcov_prefix');
|
||||
const name = core.getInput('name');
|
||||
const override_branch = core.getInput('override_branch');
|
||||
const override_build = core.getInput('override_build');
|
||||
const override_commit = core.getInput('override_commit');
|
||||
const override_pr = core.getInput('override_pr');
|
||||
const override_tag = core.getInput('override_tag');
|
||||
const root_dir = core.getInput('root_dir');
|
||||
const search_dir = core.getInput('directory');
|
||||
const overrideBranch = core.getInput('override_branch');
|
||||
const overrideBuild = core.getInput('override_build');
|
||||
const overrideCommit = core.getInput('override_commit');
|
||||
const overridePr = core.getInput('override_pr');
|
||||
const overrideTag = core.getInput('override_tag');
|
||||
const rootDir = core.getInput('root_dir');
|
||||
const searchDir = core.getInput('directory');
|
||||
const token = core.getInput('token');
|
||||
const verbose = isTrue(core.getInput('verbose'));
|
||||
const working_dir = core.getInput('working-directory');
|
||||
const write_path = core.getInput('path_to_write_report');
|
||||
const xcode_derived_data = core.getInput('xcode_derived_data');
|
||||
const xcode_package = core.getInput('xcode_package');
|
||||
const workingDir = core.getInput('working-directory');
|
||||
const writePath = core.getInput('path_to_write_report');
|
||||
const xcodeDerivedData = core.getInput('xcode_derived_data');
|
||||
const xcodePackage = core.getInput('xcode_package');
|
||||
|
||||
const filepath = working_dir ?
|
||||
working_dir + '/codecov.sh' : 'codecov.sh';
|
||||
const filepath = workingDir ?
|
||||
workingDir + '/codecov.sh' : 'codecov.sh';
|
||||
|
||||
const execArgs = [filepath];
|
||||
execArgs.push( '-n', `${name}`, '-F', `${flags}`, '-Q', 'github-action' );
|
||||
@@ -59,12 +59,12 @@ const buildExec = () => {
|
||||
GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF || '',
|
||||
});
|
||||
|
||||
const env_vars_arg = [];
|
||||
for (const env_var of env_vars.split(',')) {
|
||||
const env_var_clean = env_var.trim();
|
||||
if (env_var_clean) {
|
||||
options.env[env_var_clean] = process.env[env_var_clean];
|
||||
env_vars_arg.push(env_var_clean);
|
||||
const envVarsArg = [];
|
||||
for (const envVar of envVars.split(',')) {
|
||||
const envVarClean = envVar.trim();
|
||||
if (envVarClean) {
|
||||
options.env[envVarClean] = process.env[envVarClean];
|
||||
envVarsArg.push(envVarClean);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,19 +74,19 @@ const buildExec = () => {
|
||||
if (clean) {
|
||||
execArgs.push('-c');
|
||||
}
|
||||
if (commit_parent) {
|
||||
execArgs.push('-N', `${commit_parent}`);
|
||||
if (commitParent) {
|
||||
execArgs.push('-N', `${commitParent}`);
|
||||
}
|
||||
if (curl_aws_args) {
|
||||
execArgs.push('-A', `${curl_aws_args}`);
|
||||
if (curlAwsArgs) {
|
||||
execArgs.push('-A', `${curlAwsArgs}`);
|
||||
}
|
||||
if (curl_codecov_args) {
|
||||
execArgs.push('-U', `${curl_codecov_args}`);
|
||||
if (curlCodecovArgs) {
|
||||
execArgs.push('-U', `${curlCodecovArgs}`);
|
||||
}
|
||||
if (env_vars_arg.length) {
|
||||
execArgs.push('-e', env_vars_arg.join(','));
|
||||
if (envVarsArg.length) {
|
||||
execArgs.push('-e', envVarsArg.join(','));
|
||||
}
|
||||
if (fail_ci) {
|
||||
if (failCi) {
|
||||
execArgs.push('-Z');
|
||||
}
|
||||
if (file) {
|
||||
@@ -102,62 +102,62 @@ const buildExec = () => {
|
||||
execArgs.push('-X', `${f}`);
|
||||
});
|
||||
}
|
||||
if (gcov_args) {
|
||||
execArgs.push('-a', `${gcov_args}`);
|
||||
if (gcovArgs) {
|
||||
execArgs.push('-a', `${gcovArgs}`);
|
||||
}
|
||||
if (gcov_dir) {
|
||||
execArgs.push('-p', `${gcov_dir}`);
|
||||
if (gcovDir) {
|
||||
execArgs.push('-p', `${gcovDir}`);
|
||||
}
|
||||
if (gcov_exclude) {
|
||||
execArgs.push('-g', `${gcov_exclude}`);
|
||||
if (gcovExclude) {
|
||||
execArgs.push('-g', `${gcovExclude}`);
|
||||
}
|
||||
if (gcov_exec) {
|
||||
execArgs.push('-x', `${gcov_exec}`);
|
||||
if (gcovExec) {
|
||||
execArgs.push('-x', `${gcovExec}`);
|
||||
}
|
||||
if (gcov_include) {
|
||||
execArgs.push('-G', `${gcov_include}`);
|
||||
if (gcovInclude) {
|
||||
execArgs.push('-G', `${gcovInclude}`);
|
||||
}
|
||||
if (gcov_prefix) {
|
||||
execArgs.push('-k', `${gcov_prefix}`);
|
||||
if (gcovPrefix) {
|
||||
execArgs.push('-k', `${gcovPrefix}`);
|
||||
}
|
||||
if (override_branch) {
|
||||
execArgs.push('-B', `${override_branch}`);
|
||||
if (overrideBranch) {
|
||||
execArgs.push('-B', `${overrideBranch}`);
|
||||
}
|
||||
if (override_build) {
|
||||
execArgs.push('-b', `${override_build}`);
|
||||
if (overrideBuild) {
|
||||
execArgs.push('-b', `${overrideBuild}`);
|
||||
}
|
||||
if (override_commit) {
|
||||
execArgs.push('-C', `${override_commit}`);
|
||||
if (overrideCommit) {
|
||||
execArgs.push('-C', `${overrideCommit}`);
|
||||
}
|
||||
if (override_pr) {
|
||||
execArgs.push('-P', `${override_pr}`);
|
||||
if (overridePr) {
|
||||
execArgs.push('-P', `${overridePr}`);
|
||||
}
|
||||
if (override_tag) {
|
||||
execArgs.push('-T', `${override_tag}`);
|
||||
if (overrideTag) {
|
||||
execArgs.push('-T', `${overrideTag}`);
|
||||
}
|
||||
if (root_dir) {
|
||||
execArgs.push('-N', `${root_dir}`);
|
||||
if (rootDir) {
|
||||
execArgs.push('-N', `${rootDir}`);
|
||||
}
|
||||
if (search_dir) {
|
||||
execArgs.push('-s', `${search_dir}`);
|
||||
if (searchDir) {
|
||||
execArgs.push('-s', `${searchDir}`);
|
||||
}
|
||||
if (verbose) {
|
||||
execArgs.push('-v');
|
||||
}
|
||||
if (working_dir) {
|
||||
options.cwd = working_dir;
|
||||
if (workingDir) {
|
||||
options.cwd = workingDir;
|
||||
}
|
||||
if (write_path) {
|
||||
execArgs.push('-q', `${write_path}`);
|
||||
if (writePath) {
|
||||
execArgs.push('-q', `${writePath}`);
|
||||
}
|
||||
if (xcode_derived_data) {
|
||||
execArgs.push('-D', `${xcode_derived_data}`);
|
||||
if (xcodeDerivedData) {
|
||||
execArgs.push('-D', `${xcodeDerivedData}`);
|
||||
}
|
||||
if (xcode_package) {
|
||||
execArgs.push('-J', `${xcode_package}`);
|
||||
if (xcodePackage) {
|
||||
execArgs.push('-J', `${xcodePackage}`);
|
||||
}
|
||||
|
||||
return {execArgs, options, filepath, fail_ci};
|
||||
return {execArgs, options, filepath, failCi};
|
||||
};
|
||||
|
||||
export default buildExec;
|
||||
|
||||
Reference in New Issue
Block a user