mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-13 14:37:24 +00:00
add tests
This commit is contained in:
parent
42678fbd62
commit
35d7f20bdb
5 changed files with 272 additions and 51 deletions
44
dist/index.js
vendored
44
dist/index.js
vendored
|
|
@ -22344,8 +22344,8 @@ const buildUploadExec = () => {
|
||||||
const workingDir = core.getInput('working-directory');
|
const workingDir = core.getInput('working-directory');
|
||||||
const plugin = core.getInput('plugin');
|
const plugin = core.getInput('plugin');
|
||||||
const exclude = core.getInput('exclude');
|
const exclude = core.getInput('exclude');
|
||||||
const execUploadArgs = [];
|
const uploadExecArgs = [];
|
||||||
execUploadArgs.push('-n', `${name}`);
|
uploadExecArgs.push('-n', `${name}`);
|
||||||
const uploadCommand = 'do-upload';
|
const uploadCommand = 'do-upload';
|
||||||
const uploadOptions = {};
|
const uploadOptions = {};
|
||||||
uploadOptions.env = Object.assign(process.env, {
|
uploadOptions.env = Object.assign(process.env, {
|
||||||
|
|
@ -22368,69 +22368,69 @@ const buildUploadExec = () => {
|
||||||
uploadOptions.env.CODECOV_TOKEN = token;
|
uploadOptions.env.CODECOV_TOKEN = token;
|
||||||
}
|
}
|
||||||
if (dryRun) {
|
if (dryRun) {
|
||||||
execUploadArgs.push('-d');
|
uploadExecArgs.push('-d');
|
||||||
}
|
}
|
||||||
if (envVarsArg.length) {
|
if (envVarsArg.length) {
|
||||||
execUploadArgs.push('-e', envVarsArg.join(','));
|
uploadExecArgs.push('-e', envVarsArg.join(','));
|
||||||
}
|
}
|
||||||
if (failCi) {
|
if (failCi) {
|
||||||
execUploadArgs.push('-Z');
|
uploadExecArgs.push('-Z');
|
||||||
}
|
}
|
||||||
if (file) {
|
if (file) {
|
||||||
execUploadArgs.push('-f', `${file}`);
|
uploadExecArgs.push('-f', `${file}`);
|
||||||
}
|
}
|
||||||
if (files) {
|
if (files) {
|
||||||
files.split(',').map((f) => f.trim()).forEach((f) => {
|
files.split(',').map((f) => f.trim()).forEach((f) => {
|
||||||
execUploadArgs.push('-f', `${f}`);
|
uploadExecArgs.push('-f', `${f}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (flags) {
|
if (flags) {
|
||||||
flags.split(',').map((f) => f.trim()).forEach((f) => {
|
flags.split(',').map((f) => f.trim()).forEach((f) => {
|
||||||
execUploadArgs.push('-F', `${f}`);
|
uploadExecArgs.push('-F', `${f}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (overrideBranch) {
|
if (overrideBranch) {
|
||||||
execUploadArgs.push('-B', `${overrideBranch}`);
|
uploadExecArgs.push('-B', `${overrideBranch}`);
|
||||||
}
|
}
|
||||||
if (overrideBuild) {
|
if (overrideBuild) {
|
||||||
execUploadArgs.push('-b', `${overrideBuild}`);
|
uploadExecArgs.push('-b', `${overrideBuild}`);
|
||||||
}
|
}
|
||||||
if (overrideCommit) {
|
if (overrideCommit) {
|
||||||
execUploadArgs.push('-C', `${overrideCommit}`);
|
uploadExecArgs.push('-C', `${overrideCommit}`);
|
||||||
}
|
}
|
||||||
else if (`${context.eventName}` == 'pull_request' ||
|
else if (`${context.eventName}` == 'pull_request' ||
|
||||||
`${context.eventName}` == 'pull_request_target') {
|
`${context.eventName}` == 'pull_request_target') {
|
||||||
execUploadArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
uploadExecArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
}
|
}
|
||||||
if (overridePr) {
|
if (overridePr) {
|
||||||
execUploadArgs.push('-P', `${overridePr}`);
|
uploadExecArgs.push('-P', `${overridePr}`);
|
||||||
}
|
}
|
||||||
else if (`${context.eventName}` == 'pull_request_target') {
|
else if (`${context.eventName}` == 'pull_request_target') {
|
||||||
execUploadArgs.push('-P', `${context.payload.number}`);
|
uploadExecArgs.push('-P', `${context.payload.number}`);
|
||||||
}
|
}
|
||||||
if (rootDir) {
|
if (rootDir) {
|
||||||
execUploadArgs.push('--network-root-folder', `${rootDir}`);
|
uploadExecArgs.push('--network-root-folder', `${rootDir}`);
|
||||||
}
|
}
|
||||||
if (searchDir) {
|
if (searchDir) {
|
||||||
execUploadArgs.push('-s', `${searchDir}`);
|
uploadExecArgs.push('-s', `${searchDir}`);
|
||||||
}
|
}
|
||||||
if (slug) {
|
if (slug) {
|
||||||
execUploadArgs.push('-r', `${slug}`);
|
uploadExecArgs.push('-r', `${slug}`);
|
||||||
}
|
}
|
||||||
if (workingDir) {
|
if (workingDir) {
|
||||||
uploadOptions.cwd = workingDir;
|
uploadOptions.cwd = workingDir;
|
||||||
}
|
}
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
execUploadArgs.push('--plugin', `${plugin}`);
|
uploadExecArgs.push('--plugin', `${plugin}`);
|
||||||
}
|
}
|
||||||
if (exclude) {
|
if (exclude) {
|
||||||
execUploadArgs.push('--exclude', `${exclude}`);
|
uploadExecArgs.push('--exclude', `${exclude}`);
|
||||||
}
|
}
|
||||||
if (uploaderVersion == '') {
|
if (uploaderVersion == '') {
|
||||||
uploaderVersion = 'latest';
|
uploaderVersion = 'latest';
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
execUploadArgs,
|
uploadExecArgs,
|
||||||
uploadOptions,
|
uploadOptions,
|
||||||
failCi,
|
failCi,
|
||||||
os,
|
os,
|
||||||
|
|
@ -22438,7 +22438,7 @@ const buildUploadExec = () => {
|
||||||
uploadCommand,
|
uploadCommand,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
/* harmony default export */ const src_buildExec = (buildExec);
|
|
||||||
|
|
||||||
;// CONCATENATED MODULE: ./src/helpers.ts
|
;// CONCATENATED MODULE: ./src/helpers.ts
|
||||||
|
|
||||||
|
|
@ -24756,7 +24756,7 @@ var src_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argu
|
||||||
|
|
||||||
let failCi;
|
let failCi;
|
||||||
try {
|
try {
|
||||||
const { execArgs, options, failCi, os, uploaderVersion, verbose } = src_buildExec();
|
const { execArgs, options, failCi, os, uploaderVersion, verbose } = buildExec();
|
||||||
const platform = getPlatform(os);
|
const platform = getPlatform(os);
|
||||||
const filename = external_path_.join(__dirname, getUploaderName(platform));
|
const filename = external_path_.join(__dirname, getUploaderName(platform));
|
||||||
external_https_.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
external_https_.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
||||||
|
|
|
||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,9 +1,14 @@
|
||||||
import * as github from '@actions/github';
|
import * as github from '@actions/github';
|
||||||
|
|
||||||
import buildExec from './buildExec';
|
import {
|
||||||
|
buildCommitExec,
|
||||||
|
buildExec,
|
||||||
|
buildGeneralExec,
|
||||||
|
buildReportExec,
|
||||||
|
buildUploadExec,
|
||||||
|
} from './buildExec';
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
import {version} from '../package.json';
|
||||||
const {version} = require('../package.json');
|
|
||||||
|
|
||||||
const context = github.context;
|
const context = github.context;
|
||||||
|
|
||||||
|
|
@ -19,6 +24,7 @@ test('no arguments', () => {
|
||||||
if (context.eventName == 'pull_request') {
|
if (context.eventName == 'pull_request') {
|
||||||
args.push('-C', `${context.payload.pull_request.head.sha}`);
|
args.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(execArgs).toEqual(args);
|
expect(execArgs).toEqual(args);
|
||||||
expect(failCi).toBeFalsy();
|
expect(failCi).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
@ -131,7 +137,7 @@ describe('trim arguments after splitting them', () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
test('files', () => {
|
test('files', () => {
|
||||||
const envs = {'files': './client-coverage.txt, ./lcov.info'};
|
const envs = {files: './client-coverage.txt, ./lcov.info'};
|
||||||
|
|
||||||
for (const [name, value] of Object.entries(envs)) {
|
for (const [name, value] of Object.entries(envs)) {
|
||||||
process.env['INPUT_' + name.toUpperCase()] = value;
|
process.env['INPUT_' + name.toUpperCase()] = value;
|
||||||
|
|
@ -155,7 +161,7 @@ describe('trim arguments after splitting them', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('flags', () => {
|
test('flags', () => {
|
||||||
const envs = {'flags': 'ios, mobile'};
|
const envs = {flags: 'ios, mobile'};
|
||||||
|
|
||||||
for (const [name, value] of Object.entries(envs)) {
|
for (const [name, value] of Object.entries(envs)) {
|
||||||
process.env['INPUT_' + name.toUpperCase()] = value;
|
process.env['INPUT_' + name.toUpperCase()] = value;
|
||||||
|
|
@ -179,7 +185,7 @@ describe('trim arguments after splitting them', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('functionalities', () => {
|
test('functionalities', () => {
|
||||||
const envs = {'functionalities': 'network, gcov'};
|
const envs = {functionalities: 'network, gcov'};
|
||||||
|
|
||||||
for (const [name, value] of Object.entries(envs)) {
|
for (const [name, value] of Object.entries(envs)) {
|
||||||
process.env['INPUT_' + name.toUpperCase()] = value;
|
process.env['INPUT_' + name.toUpperCase()] = value;
|
||||||
|
|
@ -202,3 +208,212 @@ describe('trim arguments after splitting them', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('general args', () => {
|
||||||
|
const envs = {
|
||||||
|
url: 'https://codecov.enterprise.com',
|
||||||
|
verbose: 't',
|
||||||
|
};
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
||||||
|
}
|
||||||
|
|
||||||
|
const args = buildGeneralExec();
|
||||||
|
|
||||||
|
expect(args).toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
'--enterprise-url',
|
||||||
|
'https://codecov.enterprise.com',
|
||||||
|
'-v',
|
||||||
|
]));
|
||||||
|
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
test('upload args using context', () => {
|
||||||
|
const expectedArgs = [
|
||||||
|
'-n',
|
||||||
|
'',
|
||||||
|
];
|
||||||
|
const {uploadExecArgs, uploadCommand} = buildUploadExec();
|
||||||
|
if (context.eventName == 'pull_request') {
|
||||||
|
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
|
}
|
||||||
|
if (context.eventName == 'pull_request_target') {
|
||||||
|
expectedArgs.push('-P', `${context.payload.number}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(uploadExecArgs).toEqual(expectedArgs);
|
||||||
|
expect(uploadCommand).toEqual('do-upload');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('upload args', () => {
|
||||||
|
const envs = {
|
||||||
|
'directory': 'coverage/',
|
||||||
|
'dry_run': 'true',
|
||||||
|
'env_vars': 'OS,PYTHON',
|
||||||
|
'fail_ci_if_error': 'true',
|
||||||
|
'file': 'coverage.xml',
|
||||||
|
'files': 'dir1/coverage.xml,dir2/coverage.xml',
|
||||||
|
'flags': 'test,test2',
|
||||||
|
'name': 'codecov',
|
||||||
|
'override_branch': 'thomasrockhu/test',
|
||||||
|
'override_build': '1',
|
||||||
|
'override_commit': '9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
|
'override_pr': '2',
|
||||||
|
'root_dir': 'root/',
|
||||||
|
'slug': 'fakeOwner/fakeRepo',
|
||||||
|
'token': 'd3859757-ab80-4664-924d-aef22fa7557b',
|
||||||
|
'working-directory': 'src',
|
||||||
|
'plugin': 'xcode',
|
||||||
|
'exclude': 'src',
|
||||||
|
};
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
||||||
|
}
|
||||||
|
|
||||||
|
const {uploadExecArgs, uploadCommand} = buildUploadExec();
|
||||||
|
const expectedArgs = [
|
||||||
|
'-n',
|
||||||
|
'codecov',
|
||||||
|
'-d',
|
||||||
|
'-e',
|
||||||
|
'OS,PYTHON',
|
||||||
|
'-Z',
|
||||||
|
'-f',
|
||||||
|
'coverage.xml',
|
||||||
|
'-f',
|
||||||
|
'dir1/coverage.xml',
|
||||||
|
'-f',
|
||||||
|
'dir2/coverage.xml',
|
||||||
|
'-F',
|
||||||
|
'test',
|
||||||
|
'-F',
|
||||||
|
'test2',
|
||||||
|
'-B',
|
||||||
|
'thomasrockhu/test',
|
||||||
|
'-b',
|
||||||
|
'1',
|
||||||
|
'-C',
|
||||||
|
'9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
|
'-P',
|
||||||
|
'2',
|
||||||
|
'--network-root-folder',
|
||||||
|
'root/',
|
||||||
|
'-s',
|
||||||
|
'coverage/',
|
||||||
|
'-r',
|
||||||
|
'fakeOwner/fakeRepo',
|
||||||
|
'--plugin',
|
||||||
|
'xcode',
|
||||||
|
'--exclude',
|
||||||
|
'src',
|
||||||
|
];
|
||||||
|
|
||||||
|
expect(uploadExecArgs).toEqual(expectedArgs);
|
||||||
|
expect(uploadCommand).toEqual('do-upload');
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
test('report args', () => {
|
||||||
|
const envs = {
|
||||||
|
override_commit: '9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
|
slug: 'fakeOwner/fakeRepo',
|
||||||
|
token: 'd3859757-ab80-4664-924d-aef22fa7557b',
|
||||||
|
};
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
||||||
|
}
|
||||||
|
|
||||||
|
const {reportExecArgs, reportCommand} = buildReportExec();
|
||||||
|
|
||||||
|
expect(reportExecArgs).toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
'-C',
|
||||||
|
'9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
|
'--slug',
|
||||||
|
'fakeOwner/fakeRepo',
|
||||||
|
]));
|
||||||
|
expect(reportCommand).toEqual('create-report');
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
test('report args using context', () => {
|
||||||
|
const envs = {
|
||||||
|
token: 'd3859757-ab80-4664-924d-aef22fa7557b',
|
||||||
|
};
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
||||||
|
}
|
||||||
|
const expectedArgs : string[] = [];
|
||||||
|
if (context.eventName == 'pull_request') {
|
||||||
|
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const {reportExecArgs, reportCommand} = buildReportExec();
|
||||||
|
|
||||||
|
expect(reportExecArgs).toEqual(expectedArgs);
|
||||||
|
expect(reportCommand).toEqual('create-report');
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
test('commit args', () => {
|
||||||
|
const envs = {
|
||||||
|
override_commit: '9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
|
slug: 'fakeOwner/fakeRepo',
|
||||||
|
token: 'd3859757-ab80-4664-924d-aef22fa7557b',
|
||||||
|
override_branch: 'thomasrockhu/test',
|
||||||
|
override_pr: '2',
|
||||||
|
commit_parent: '83231650328f11695dfb754ca0f540516f188d27',
|
||||||
|
};
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
||||||
|
}
|
||||||
|
|
||||||
|
const {commitExecArgs, commitCommand} = buildCommitExec();
|
||||||
|
|
||||||
|
expect(commitExecArgs).toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
'-C',
|
||||||
|
'9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
|
'--slug',
|
||||||
|
'fakeOwner/fakeRepo',
|
||||||
|
'-B',
|
||||||
|
'thomasrockhu/test',
|
||||||
|
'--pr',
|
||||||
|
'2',
|
||||||
|
'--parent-sha',
|
||||||
|
'83231650328f11695dfb754ca0f540516f188d27',
|
||||||
|
]));
|
||||||
|
expect(commitCommand).toEqual('create-commit');
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test('commit args using context', () => {
|
||||||
|
const expectedArgs :string[] = [];
|
||||||
|
|
||||||
|
const {commitExecArgs, commitCommand} = buildCommitExec();
|
||||||
|
if (context.eventName == 'pull_request') {
|
||||||
|
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
|
}
|
||||||
|
if (context.eventName == 'pull_request_target') {
|
||||||
|
expectedArgs.push('-P', `${context.payload.number}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(commitExecArgs).toEqual(expectedArgs);
|
||||||
|
expect(commitCommand).toEqual('create-commit');
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -313,8 +313,8 @@ const buildUploadExec = () => {
|
||||||
const plugin = core.getInput('plugin');
|
const plugin = core.getInput('plugin');
|
||||||
const exclude = core.getInput('exclude');
|
const exclude = core.getInput('exclude');
|
||||||
|
|
||||||
const execUploadArgs = [];
|
const uploadExecArgs = [];
|
||||||
execUploadArgs.push(
|
uploadExecArgs.push(
|
||||||
'-n',
|
'-n',
|
||||||
`${name}`,
|
`${name}`,
|
||||||
);
|
);
|
||||||
|
|
@ -342,65 +342,65 @@ const buildUploadExec = () => {
|
||||||
uploadOptions.env.CODECOV_TOKEN = token;
|
uploadOptions.env.CODECOV_TOKEN = token;
|
||||||
}
|
}
|
||||||
if (dryRun) {
|
if (dryRun) {
|
||||||
execUploadArgs.push('-d');
|
uploadExecArgs.push('-d');
|
||||||
}
|
}
|
||||||
if (envVarsArg.length) {
|
if (envVarsArg.length) {
|
||||||
execUploadArgs.push('-e', envVarsArg.join(','));
|
uploadExecArgs.push('-e', envVarsArg.join(','));
|
||||||
}
|
}
|
||||||
if (failCi) {
|
if (failCi) {
|
||||||
execUploadArgs.push('-Z');
|
uploadExecArgs.push('-Z');
|
||||||
}
|
}
|
||||||
if (file) {
|
if (file) {
|
||||||
execUploadArgs.push('-f', `${file}`);
|
uploadExecArgs.push('-f', `${file}`);
|
||||||
}
|
}
|
||||||
if (files) {
|
if (files) {
|
||||||
files.split(',').map((f) => f.trim()).forEach((f) => {
|
files.split(',').map((f) => f.trim()).forEach((f) => {
|
||||||
execUploadArgs.push('-f', `${f}`);
|
uploadExecArgs.push('-f', `${f}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (flags) {
|
if (flags) {
|
||||||
flags.split(',').map((f) => f.trim()).forEach((f) => {
|
flags.split(',').map((f) => f.trim()).forEach((f) => {
|
||||||
execUploadArgs.push('-F', `${f}`);
|
uploadExecArgs.push('-F', `${f}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (overrideBranch) {
|
if (overrideBranch) {
|
||||||
execUploadArgs.push('-B', `${overrideBranch}`);
|
uploadExecArgs.push('-B', `${overrideBranch}`);
|
||||||
}
|
}
|
||||||
if (overrideBuild) {
|
if (overrideBuild) {
|
||||||
execUploadArgs.push('-b', `${overrideBuild}`);
|
uploadExecArgs.push('-b', `${overrideBuild}`);
|
||||||
}
|
}
|
||||||
if (overrideCommit) {
|
if (overrideCommit) {
|
||||||
execUploadArgs.push('-C', `${overrideCommit}`);
|
uploadExecArgs.push('-C', `${overrideCommit}`);
|
||||||
} else if (
|
} else if (
|
||||||
`${context.eventName}` == 'pull_request' ||
|
`${context.eventName}` == 'pull_request' ||
|
||||||
`${context.eventName}` == 'pull_request_target'
|
`${context.eventName}` == 'pull_request_target'
|
||||||
) {
|
) {
|
||||||
execUploadArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
uploadExecArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
}
|
}
|
||||||
if (overridePr) {
|
if (overridePr) {
|
||||||
execUploadArgs.push('-P', `${overridePr}`);
|
uploadExecArgs.push('-P', `${overridePr}`);
|
||||||
} else if (
|
} else if (
|
||||||
`${context.eventName}` == 'pull_request_target'
|
`${context.eventName}` == 'pull_request_target'
|
||||||
) {
|
) {
|
||||||
execUploadArgs.push('-P', `${context.payload.number}`);
|
uploadExecArgs.push('-P', `${context.payload.number}`);
|
||||||
}
|
}
|
||||||
if (rootDir) {
|
if (rootDir) {
|
||||||
execUploadArgs.push('--network-root-folder', `${rootDir}`);
|
uploadExecArgs.push('--network-root-folder', `${rootDir}`);
|
||||||
}
|
}
|
||||||
if (searchDir) {
|
if (searchDir) {
|
||||||
execUploadArgs.push('-s', `${searchDir}`);
|
uploadExecArgs.push('-s', `${searchDir}`);
|
||||||
}
|
}
|
||||||
if (slug) {
|
if (slug) {
|
||||||
execUploadArgs.push('-r', `${slug}`);
|
uploadExecArgs.push('-r', `${slug}`);
|
||||||
}
|
}
|
||||||
if (workingDir) {
|
if (workingDir) {
|
||||||
uploadOptions.cwd = workingDir;
|
uploadOptions.cwd = workingDir;
|
||||||
}
|
}
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
execUploadArgs.push('--plugin', `${plugin}`);
|
uploadExecArgs.push('--plugin', `${plugin}`);
|
||||||
}
|
}
|
||||||
if (exclude) {
|
if (exclude) {
|
||||||
execUploadArgs.push('--exclude', `${exclude}`);
|
uploadExecArgs.push('--exclude', `${exclude}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uploaderVersion == '') {
|
if (uploaderVersion == '') {
|
||||||
|
|
@ -408,7 +408,7 @@ const buildUploadExec = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
execUploadArgs,
|
uploadExecArgs,
|
||||||
uploadOptions,
|
uploadOptions,
|
||||||
failCi,
|
failCi,
|
||||||
os,
|
os,
|
||||||
|
|
@ -418,4 +418,10 @@ const buildUploadExec = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default buildExec;
|
export {
|
||||||
|
buildExec,
|
||||||
|
buildCommitExec,
|
||||||
|
buildGeneralExec,
|
||||||
|
buildReportExec,
|
||||||
|
buildUploadExec,
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import * as path from 'path';
|
||||||
|
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
|
|
||||||
import buildExec from './buildExec';
|
import {buildExec} from './buildExec';
|
||||||
import {
|
import {
|
||||||
getBaseUrl,
|
getBaseUrl,
|
||||||
getPlatform,
|
getPlatform,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue