mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 08:06:27 +00:00
Add all the bash params
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
### 1.2.0
|
||||||
|
|
||||||
|
#### Features
|
||||||
|
- #185 [Placeholder]
|
||||||
|
|
||||||
|
#### Fixes
|
||||||
|
- #185 [Placeholder]
|
||||||
|
|
||||||
### 1.1.1
|
### 1.1.1
|
||||||
|
|
||||||
#### Fixes
|
#### Fixes
|
||||||
|
|||||||
34
README.md
34
README.md
@@ -20,7 +20,6 @@ steps:
|
|||||||
- uses: codecov/codecov-action@v1
|
- uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
||||||
file: ./coverage.xml # optional
|
|
||||||
files: ./coverage1.xml,./coverage2.xml # optional
|
files: ./coverage1.xml,./coverage2.xml # optional
|
||||||
flags: unittests # optional
|
flags: unittests # optional
|
||||||
name: codecov-umbrella # optional
|
name: codecov-umbrella # optional
|
||||||
@@ -36,16 +35,42 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
|
|||||||
| Input | Description | Usage |
|
| Input | Description | Usage |
|
||||||
| :---: | :---: | :---: |
|
| :---: | :---: | :---: |
|
||||||
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
|
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
|
||||||
| `file` | Path to the coverage report(s) | Optional
|
|
||||||
| `files` | Comma-separated paths to the coverage report(s) | Optional
|
| `files` | Comma-separated paths to the coverage report(s) | Optional
|
||||||
| `directory` | Directory to search for coverage reports. | Optional
|
| `directory` | Directory to search for coverage reports. | Optional
|
||||||
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
|
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
|
||||||
|
| | |
|
||||||
|
| `aws_curl_args` | Extra curl arguments to communicate with AWS. | Optional
|
||||||
|
| `codecov_curl_args` | Extra curl arguments to communicate with Codecov. e.g., -U "--proxy http://http-proxy" | Optional
|
||||||
|
| `commit_parent` | The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository provider's API, the parent is determined via finding the closest ancestor to the commit. | Optional
|
||||||
| `env_vars` | Environment variables to tag the upload with. Multiple env variables can be separated with commas (e.g. `OS,PYTHON`) | Optional
|
| `env_vars` | Environment variables to tag the upload with. Multiple env variables can be separated with commas (e.g. `OS,PYTHON`) | Optional
|
||||||
| `name` | Custom defined name for the upload | Optional
|
|
||||||
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
|
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
|
||||||
|
| `functionalities` | Toggle functionalities | Optional
|
||||||
|
| | `coveragepy` Disable python coverage |
|
||||||
|
| | `fix` Disable report fixing |
|
||||||
|
| | `gcov` Disable gcov |
|
||||||
|
| | `gcovout` Disable gcov output |
|
||||||
|
| | `html` Enable coverage for HTML files |
|
||||||
|
| | `network` Disable uploading the file network |
|
||||||
|
| | `recursesubs` Enable recurse submodules in git projects when searching for source files | |
|
||||||
|
| | `search` Disable searching for reports |
|
||||||
|
| | `xcode` Disable xcode processing |
|
||||||
|
| `gcov path_include` | Paths to include during gcov gathering (as a glob) | Optional
|
||||||
|
| `gcov_args` | extra arguments to pass to gcov | Optional
|
||||||
|
| `gcov_executable` | gcov executable to run. Defaults to 'gcov' | Optional
|
||||||
|
| `gcov_path_exclude` | Paths to ignore during gcov gathering (as a glob) | Optional
|
||||||
|
| `gcov_prefix` | Prefix filepaths to help resolve path fixing | Optional
|
||||||
|
| `gcov_root_dir` | Project root directory, also used when preparing gcov | Optional
|
||||||
|
| `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional
|
||||||
|
| `name` | Custom defined name for the upload | Optional
|
||||||
|
| `override_branch` | Specify the branch name | Optional
|
||||||
|
| `override_build` | Specify the build number | Optional
|
||||||
|
| `override_commit` | Specify the commit SHA | Optional
|
||||||
|
| `override_pr` | Specify the pull request number | Optional
|
||||||
|
| `override_tag` | Specify the git tag | Optional
|
||||||
| `path_to_write_report` | Write upload file to path before uploading | Optional
|
| `path_to_write_report` | Write upload file to path before uploading | Optional
|
||||||
|
| `root_dir` | Used when not in git/hg project to identify project root directory | Optional
|
||||||
| `verbose` | Specify whether the Codecov output should be verbose | Optional
|
| `verbose` | Specify whether the Codecov output should be verbose | Optional
|
||||||
| `working-directory` | Directory in which to execute `codecov.sh` | Optional
|
| `working_directory` | Directory in which to execute `codecov.sh` | Optional
|
||||||
| `xcode_derived_data` | Custom Derived Data Path for Coverage.profdata and gcov processing | Optional
|
| `xcode_derived_data` | Custom Derived Data Path for Coverage.profdata and gcov processing | Optional
|
||||||
| `xcode_package` | Specify packages to build coverage. Uploader will only build these packages. This can significantly reduces time to build coverage reports. -J 'MyAppName' Will match "MyAppName" and "MyAppNameTests" -J '^ExampleApp$' Will match only "ExampleApp" not "ExampleAppTests" | Optional
|
| `xcode_package` | Specify packages to build coverage. Uploader will only build these packages. This can significantly reduces time to build coverage reports. -J 'MyAppName' Will match "MyAppName" and "MyAppNameTests" -J '^ExampleApp$' Will match only "ExampleApp" not "ExampleAppTests" | Optional
|
||||||
|
|
||||||
@@ -78,7 +103,6 @@ jobs:
|
|||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
file: ./coverage.xml
|
|
||||||
files: ./coverage1.xml,./coverage2.xml
|
files: ./coverage1.xml,./coverage2.xml
|
||||||
directory: ./coverage/reports/
|
directory: ./coverage/reports/
|
||||||
flags: unittests
|
flags: unittests
|
||||||
|
|||||||
170
dist/index.js
vendored
170
dist/index.js
vendored
@@ -2519,47 +2519,50 @@ const exec = __webpack_require__(986);
|
|||||||
const fs = __webpack_require__(747);
|
const fs = __webpack_require__(747);
|
||||||
const request = __webpack_require__(335);
|
const request = __webpack_require__(335);
|
||||||
|
|
||||||
let fail_ci;
|
|
||||||
let verbose;
|
|
||||||
try {
|
try {
|
||||||
const name = core.getInput("name");
|
let isTrue = (variable) => {
|
||||||
const token = core.getInput("token");
|
const lowercase = variable.toLowerCase();
|
||||||
const flags = core.getInput("flags");
|
return (
|
||||||
const file = core.getInput("file");
|
lowercase === "1" ||
|
||||||
const files = core.getInput("files");
|
lowercase === "t" ||
|
||||||
|
lowercase === "true" ||
|
||||||
|
lowercase === "y" ||
|
||||||
|
lowercase === "yes"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const env_vars = core.getInput("env_vars");
|
const env_vars = core.getInput("env_vars");
|
||||||
const dir = core.getInput("directory");
|
const fail_ci = isTrue(core.getInput("fail_ci_if_error"));
|
||||||
|
const files = core.getInput("files");
|
||||||
|
const flags = core.getInput("flags");
|
||||||
|
const functionalities = core.getInput("functionalities");
|
||||||
|
const name = core.getInput("name");
|
||||||
|
const search_dir = 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 write_path = core.getInput("path_to_write_report");
|
||||||
const working_dir = core.getInput("working-directory");
|
|
||||||
const xcode_derived_data = core.getInput("xcode_derived_data");
|
const xcode_derived_data = core.getInput("xcode_derived_data");
|
||||||
const xcode_package = core.getInput("xcode_package");
|
const xcode_package = core.getInput("xcode_package");
|
||||||
|
|
||||||
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
const commit_parent = core.getInput("commit_parent");
|
||||||
verbose = core.getInput("verbose").toLowerCase();
|
const root_dir = core.getInput("root_dir");
|
||||||
|
const clean = core.getInput("move_coverage_to_trash");
|
||||||
|
const gcov_exclude = core.getInput("gcov_path_exclude");
|
||||||
|
const gcov_include = core.getInput("gcov_path_include");
|
||||||
|
const gcov_dir = core.getInput("gcov_root_dir");
|
||||||
|
const gcov_prefix = core.getInput("gcov_prefix");
|
||||||
|
const gcov_exec = core.getInput("gcov_executable");
|
||||||
|
const gcov_args = core.getInput("gcov_args");
|
||||||
|
|
||||||
if (
|
const override_commit = core.getInput("override_commit");
|
||||||
fail_ci === "yes" ||
|
const override_branch = core.getInput("override_branch");
|
||||||
fail_ci === "y" ||
|
const override_pr = core.getInput("override_pr");
|
||||||
fail_ci === "true" ||
|
const override_build = core.getInput("override_build");
|
||||||
fail_ci === "t" ||
|
const override_tag = core.getInput("override_tag");
|
||||||
fail_ci === "1"
|
|
||||||
) {
|
|
||||||
fail_ci = true;
|
|
||||||
} else {
|
|
||||||
fail_ci = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
const curl_codecov_args = core.getInput("codecov_curl_args");
|
||||||
verbose === "yes" ||
|
const curl_aws_args = core.getInput("aws_curl_args");
|
||||||
verbose === "y" ||
|
|
||||||
verbose === "true" ||
|
|
||||||
verbose === "t" ||
|
|
||||||
verbose === "1"
|
|
||||||
) {
|
|
||||||
verbose = true;
|
|
||||||
} else {
|
|
||||||
verbose = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
request({
|
request({
|
||||||
json: false,
|
json: false,
|
||||||
@@ -2574,7 +2577,10 @@ try {
|
|||||||
core.warning(`Codecov warning: ${error.message}`);
|
core.warning(`Codecov warning: ${error.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFile("codecov.sh", body, err => {
|
filepath = working_dir ?
|
||||||
|
working_dir + "/codecov.sh" : "codecov.sh"
|
||||||
|
|
||||||
|
fs.writeFile(filepath, body, err => {
|
||||||
if (err && fail_ci) {
|
if (err && fail_ci) {
|
||||||
throw err;
|
throw err;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
@@ -2615,73 +2621,35 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const execArgs = ["codecov.sh"];
|
const execArgs = [filepath];
|
||||||
execArgs.push("-Q", "github-action");
|
execArgs.push( "-n", `${name}`, "-F", `${flags}`, "-Q", "github-action" );
|
||||||
|
|
||||||
if (file) {
|
if (clean) { execArgs.push( "-c"); }
|
||||||
execArgs.push(
|
if (commit_parent) { execArgs.push( "-N", `${commit_parent}`); }
|
||||||
"-f", `${file}`
|
if (curl_aws_args) { execArgs.push( "-A", `${curl_aws_args}`); }
|
||||||
);
|
if (curl_codecov_args) { execArgs.push( "-U", `${curl_codecov_args}`); }
|
||||||
}
|
if (env_vars_arg.length) { execArgs.push( "-e", env_vars_arg.join(",")); }
|
||||||
|
if (fail_ci) { execArgs.push( "-Z"); }
|
||||||
if (files) {
|
if (files) { files.split(',').forEach(f => { execArgs.push( "-f", `${f}`); }); }
|
||||||
files.split(',').forEach(f => {
|
if (functionalities) { functionalities.split(',').forEach(f => { execArgs.push( "-X", `${f}`); }); }
|
||||||
execArgs.push(
|
if (gcov_args) { execArgs.push( "-a", `${gcov_args}`); }
|
||||||
"-f", `${f}`
|
if (gcov_dir) { execArgs.push( "-p", `${gcov_dir}`); }
|
||||||
);
|
if (gcov_exclude) { execArgs.push( "-g", `${gcov_exclude}`); }
|
||||||
});
|
if (gcov_exec) { execArgs.push( "-x", `${gcov_exec}`); }
|
||||||
}
|
if (gcov_include) { execArgs.push( "-G", `${gcov_include}`); }
|
||||||
|
if (gcov_prefix) { execArgs.push( "-k", `${gcov_prefix}`); }
|
||||||
if (dir) {
|
if (override_branch) { execArgs.push( "-B", `${override_branch}`); }
|
||||||
execArgs.push(
|
if (override_build) { execArgs.push( "-b", `${override_build}`); }
|
||||||
"-s", `${dir}`
|
if (override_commit) { execArgs.push( "-C", `${override_commit}`); }
|
||||||
);
|
if (override_pr) { execArgs.push( "-P", `${override_pr}`); }
|
||||||
}
|
if (override_tag) { execArgs.push( "-T", `${override_tag}`); }
|
||||||
|
if (root_dir) { execArgs.push( "-N", `${root_dir}`); }
|
||||||
execArgs.push(
|
if (search_dir) { execArgs.push( "-s", `${search_dir}`); }
|
||||||
"-n", `${name}`,
|
if (verbose) { execArgs.push( "-v"); }
|
||||||
"-F", `${flags}`
|
if (working_dir) { options.cwd = working_dir; }
|
||||||
);
|
if (write_path) { execArgs.push( "-q", `${write_path}`); }
|
||||||
|
if (xcode_derived_data) { execArgs.push( "-D", `${xcode_derived_data}`); }
|
||||||
if (fail_ci) {
|
if (xcode_package) { execArgs.push( "-J", `${xcode_package}`); }
|
||||||
execArgs.push(
|
|
||||||
"-Z"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (env_vars_arg.length) {
|
|
||||||
execArgs.push(
|
|
||||||
"-e", env_vars_arg.join(",")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (write_path) {
|
|
||||||
execArgs.push(
|
|
||||||
"-q", `${write_path}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (verbose) {
|
|
||||||
execArgs.push(
|
|
||||||
"-v"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (working_dir) {
|
|
||||||
options.cwd = working_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xcode_derived_data) {
|
|
||||||
execArgs.push(
|
|
||||||
"-D", `${xcode_derived_data}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xcode_package) {
|
|
||||||
execArgs.push(
|
|
||||||
"-J", `${xcode_package}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
exec.exec("bash", execArgs, options)
|
exec.exec("bash", execArgs, options)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@@ -2698,7 +2666,7 @@ try {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const unlinkFile = () => {
|
const unlinkFile = () => {
|
||||||
fs.unlink("codecov.sh", err => {
|
fs.unlink(filepath, err => {
|
||||||
if (err && fail_ci) {
|
if (err && fail_ci) {
|
||||||
throw err;
|
throw err;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
|
|||||||
@@ -3,3 +3,4 @@
|
|||||||
npm i --package-lock-only
|
npm i --package-lock-only
|
||||||
npm run build
|
npm run build
|
||||||
git add dist/index.js
|
git add dist/index.js
|
||||||
|
git add package-lock.json
|
||||||
|
|||||||
200
index.js
200
index.js
@@ -3,48 +3,97 @@ const exec = require("@actions/exec");
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const request = require('requestretry');
|
const request = require('requestretry');
|
||||||
|
|
||||||
let fail_ci;
|
let isTrue = (variable) => {
|
||||||
let verbose;
|
const lowercase = variable.toLowerCase();
|
||||||
try {
|
return (
|
||||||
const name = core.getInput("name");
|
lowercase === "1" ||
|
||||||
const token = core.getInput("token");
|
lowercase === "t" ||
|
||||||
const flags = core.getInput("flags");
|
lowercase === "true" ||
|
||||||
|
lowercase === "y" ||
|
||||||
|
lowercase === "yes"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let 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 file = core.getInput("file");
|
const file = core.getInput("file");
|
||||||
const files = core.getInput("files");
|
const files = core.getInput("files");
|
||||||
const env_vars = core.getInput("env_vars");
|
const flags = core.getInput("flags");
|
||||||
const dir = core.getInput("directory");
|
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 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 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 write_path = core.getInput("path_to_write_report");
|
||||||
const working_dir = core.getInput("working-directory");
|
|
||||||
const xcode_derived_data = core.getInput("xcode_derived_data");
|
const xcode_derived_data = core.getInput("xcode_derived_data");
|
||||||
const xcode_package = core.getInput("xcode_package");
|
const xcode_package = core.getInput("xcode_package");
|
||||||
|
|
||||||
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
const filepath = working_dir ?
|
||||||
verbose = core.getInput("verbose").toLowerCase();
|
working_dir + "/codecov.sh" : "codecov.sh"
|
||||||
|
|
||||||
if (
|
const execArgs = [filepath];
|
||||||
fail_ci === "yes" ||
|
execArgs.push( "-n", `${name}`, "-F", `${flags}`, "-Q", "github-action" );
|
||||||
fail_ci === "y" ||
|
|
||||||
fail_ci === "true" ||
|
const env_vars_arg = []
|
||||||
fail_ci === "t" ||
|
for (let env_var of env_vars.split(",")) {
|
||||||
fail_ci === "1"
|
let env_var_clean = env_var.trim();
|
||||||
) {
|
if (env_var_clean) {
|
||||||
fail_ci = true;
|
options.env[env_var_clean] = process.env[env_var_clean];
|
||||||
} else {
|
env_vars_arg.push(env_var_clean)
|
||||||
fail_ci = false;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (token) { options.env.CODECOV_TOKEN = token }
|
||||||
verbose === "yes" ||
|
if (clean) { execArgs.push("-c"); }
|
||||||
verbose === "y" ||
|
if (commit_parent) { execArgs.push("-N", `${commit_parent}`); }
|
||||||
verbose === "true" ||
|
if (curl_aws_args) { execArgs.push("-A", `${curl_aws_args}`); }
|
||||||
verbose === "t" ||
|
if (curl_codecov_args) { execArgs.push("-U", `${curl_codecov_args}`); }
|
||||||
verbose === "1"
|
if (env_vars_arg.length) { execArgs.push("-e", env_vars_arg.join(",")); }
|
||||||
) {
|
if (fail_ci) { execArgs.push("-Z"); }
|
||||||
verbose = true;
|
if (file) { execArgs.push("-f", `${file}`); }
|
||||||
} else {
|
if (files) { files.split(',').forEach(f => { execArgs.push("-f", `${f}`); }); }
|
||||||
verbose = false;
|
if (functionalities) { functionalities.split(',').forEach(f => { execArgs.push("-X", `${f}`); }); }
|
||||||
}
|
if (gcov_args) { execArgs.push("-a", `${gcov_args}`); }
|
||||||
|
if (gcov_dir) { execArgs.push("-p", `${gcov_dir}`); }
|
||||||
|
if (gcov_exclude) { execArgs.push("-g", `${gcov_exclude}`); }
|
||||||
|
if (gcov_exec) { execArgs.push("-x", `${gcov_exec}`); }
|
||||||
|
if (gcov_include) { execArgs.push("-G", `${gcov_include}`); }
|
||||||
|
if (gcov_prefix) { execArgs.push("-k", `${gcov_prefix}`); }
|
||||||
|
if (override_branch) { execArgs.push("-B", `${override_branch}`); }
|
||||||
|
if (override_build) { execArgs.push("-b", `${override_build}`); }
|
||||||
|
if (override_commit) { execArgs.push("-C", `${override_commit}`); }
|
||||||
|
if (override_pr) { execArgs.push("-P", `${override_pr}`); }
|
||||||
|
if (override_tag) { execArgs.push("-T", `${override_tag}`); }
|
||||||
|
if (root_dir) { execArgs.push("-N", `${root_dir}`); }
|
||||||
|
if (search_dir) { execArgs.push("-s", `${search_dir}`); }
|
||||||
|
if (verbose) { execArgs.push("-v"); }
|
||||||
|
if (working_dir) { options.cwd = working_dir; }
|
||||||
|
if (write_path) { execArgs.push("-q", `${write_path}`); }
|
||||||
|
if (xcode_derived_data) { execArgs.push("-D", `${xcode_derived_data}`); }
|
||||||
|
if (xcode_package) { execArgs.push("-J", `${xcode_package}`); }
|
||||||
|
|
||||||
|
return execArgs, filepath, fail_ci;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
request({
|
request({
|
||||||
json: false,
|
json: false,
|
||||||
maxAttempts: 10,
|
maxAttempts: 10,
|
||||||
@@ -52,13 +101,15 @@ try {
|
|||||||
url: "https://codecov.io/bash"
|
url: "https://codecov.io/bash"
|
||||||
}, (error, response, body) => {
|
}, (error, response, body) => {
|
||||||
try {
|
try {
|
||||||
|
const execArgs, filepath, fail_ci = buildExec();
|
||||||
|
|
||||||
if (error && fail_ci) {
|
if (error && fail_ci) {
|
||||||
throw error;
|
throw error;
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
core.warning(`Codecov warning: ${error.message}`);
|
core.warning(`Codecov warning: ${error.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFile("codecov.sh", body, err => {
|
fs.writeFile(filepath, body, err => {
|
||||||
if (err && fail_ci) {
|
if (err && fail_ci) {
|
||||||
throw err;
|
throw err;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
@@ -86,87 +137,6 @@ try {
|
|||||||
GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF || ''
|
GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF || ''
|
||||||
});
|
});
|
||||||
|
|
||||||
if(token){
|
|
||||||
options.env.CODECOV_TOKEN = token
|
|
||||||
}
|
|
||||||
|
|
||||||
const env_vars_arg = []
|
|
||||||
for (let env_var of env_vars.split(",")) {
|
|
||||||
let 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 execArgs = ["codecov.sh"];
|
|
||||||
execArgs.push("-Q", "github-action");
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
execArgs.push(
|
|
||||||
"-f", `${file}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (files) {
|
|
||||||
files.split(',').forEach(f => {
|
|
||||||
execArgs.push(
|
|
||||||
"-f", `${f}`
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dir) {
|
|
||||||
execArgs.push(
|
|
||||||
"-s", `${dir}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
execArgs.push(
|
|
||||||
"-n", `${name}`,
|
|
||||||
"-F", `${flags}`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fail_ci) {
|
|
||||||
execArgs.push(
|
|
||||||
"-Z"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (env_vars_arg.length) {
|
|
||||||
execArgs.push(
|
|
||||||
"-e", env_vars_arg.join(",")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (write_path) {
|
|
||||||
execArgs.push(
|
|
||||||
"-q", `${write_path}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (verbose) {
|
|
||||||
execArgs.push(
|
|
||||||
"-v"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (working_dir) {
|
|
||||||
options.cwd = working_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xcode_derived_data) {
|
|
||||||
execArgs.push(
|
|
||||||
"-D", `${xcode_derived_data}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xcode_package) {
|
|
||||||
execArgs.push(
|
|
||||||
"-J", `${xcode_package}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
exec.exec("bash", execArgs, options)
|
exec.exec("bash", execArgs, options)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (fail_ci) {
|
if (fail_ci) {
|
||||||
@@ -182,7 +152,7 @@ try {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const unlinkFile = () => {
|
const unlinkFile = () => {
|
||||||
fs.unlink("codecov.sh", err => {
|
fs.unlink(filepath, err => {
|
||||||
if (err && fail_ci) {
|
if (err && fail_ci) {
|
||||||
throw err;
|
throw err;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
|
|||||||
3
package-lock.json
generated
3
package-lock.json
generated
@@ -2351,8 +2351,7 @@
|
|||||||
"is-docker": {
|
"is-docker": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
|
||||||
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==",
|
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw=="
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"is-extendable": {
|
"is-extendable": {
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user