Compare commits
32
Commits
node-action
...
v1.0.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
797e92895e | ||
|
|
a6337803aa | ||
|
|
2613f978c9 | ||
|
|
4c6a7296af | ||
|
|
4fec3dfa96 | ||
|
|
355d574b25 | ||
|
|
a497b16d77 | ||
|
|
ab46201142 | ||
|
|
ecf5f576a0 | ||
|
|
8c950ae5c5 | ||
|
|
3d303911df | ||
|
|
eb1ea256cb | ||
|
|
5f55456d46 | ||
|
|
ade1ebf812 | ||
|
|
31d7d88849 | ||
|
|
d608de8763 | ||
|
|
08a0ecb0f3 | ||
|
|
3dfea70b3f | ||
|
|
f291e7ca9d | ||
|
|
78d806df69 | ||
|
|
dd4242c61d | ||
|
|
fc0e9fde50 | ||
|
|
cf0e744e2c | ||
|
|
fd07c5fc0c | ||
|
|
3d11715b9e | ||
|
|
cec654a0a7 | ||
|
|
41a31f1ccf | ||
|
|
d073b23c28 | ||
|
|
11d69070bf | ||
|
|
dd2a59ac10 | ||
|
|
3ec2345d08 | ||
|
|
aea83764c6 |
+5
-2
@@ -76,7 +76,7 @@ typings/
|
|||||||
# nuxt.js build output
|
# nuxt.js build output
|
||||||
.nuxt
|
.nuxt
|
||||||
|
|
||||||
# react / gatsby
|
# react / gatsby
|
||||||
public/
|
public/
|
||||||
|
|
||||||
# vuepress build output
|
# vuepress build output
|
||||||
@@ -89,4 +89,7 @@ public/
|
|||||||
.fusebox/
|
.fusebox/
|
||||||
|
|
||||||
# DynamoDB Local files
|
# DynamoDB Local files
|
||||||
.dynamodb/
|
.dynamodb/
|
||||||
|
|
||||||
|
# macOS Finder metadata
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ inputs:
|
|||||||
yml:
|
yml:
|
||||||
description: 'Specify the location of the .codecov.yml config file'
|
description: 'Specify the location of the .codecov.yml config file'
|
||||||
required: false
|
required: false
|
||||||
|
fail_ci_if_error:
|
||||||
|
description: 'Specify whether or not CI build should fail if Codecov runs into an error during upload'
|
||||||
|
required: false
|
||||||
branding:
|
branding:
|
||||||
color: 'red'
|
color: 'red'
|
||||||
icon: 'umbrella'
|
icon: 'umbrella'
|
||||||
|
|||||||
Vendored
+124
-26
File diff suppressed because one or more lines are too long
@@ -3,19 +3,40 @@ const exec = require("@actions/exec");
|
|||||||
const request = require("request");
|
const request = require("request");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
|
let fail_ci;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const name = core.getInput("name");
|
const name = core.getInput("name");
|
||||||
const token = core.getInput("token");
|
const token = core.getInput("token");
|
||||||
const flags = core.getInput("flags");
|
const flags = core.getInput("flags");
|
||||||
const file = core.getInput("file");
|
const file = core.getInput("file");
|
||||||
const yml = core.getInput("yml");
|
const yml = core.getInput("yml");
|
||||||
|
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
||||||
|
|
||||||
|
if (
|
||||||
|
fail_ci === "yes" ||
|
||||||
|
fail_ci === "y" ||
|
||||||
|
fail_ci === "true" ||
|
||||||
|
fail_ci === "t" ||
|
||||||
|
fail_ci === "1"
|
||||||
|
) {
|
||||||
|
fail_ci = true;
|
||||||
|
} else {
|
||||||
|
fail_ci = false;
|
||||||
|
}
|
||||||
|
|
||||||
request("https://codecov.io/bash", (error, response, body) => {
|
request("https://codecov.io/bash", (error, response, body) => {
|
||||||
if (error) throw error;
|
if (error && fail_ci) {
|
||||||
|
throw error;
|
||||||
|
} else if (error) {
|
||||||
|
core.warning(`Codecov warning: ${error.message}`);
|
||||||
|
}
|
||||||
|
|
||||||
fs.writeFile("codecov.sh", body, err => {
|
fs.writeFile("codecov.sh", body, err => {
|
||||||
if (err) throw err;
|
if (err && fail_ci) {
|
||||||
|
throw err;
|
||||||
|
} else if (err) {
|
||||||
|
core.warning(`Codecov warning: ${err.message}`);
|
||||||
|
}
|
||||||
|
|
||||||
let output = "";
|
let output = "";
|
||||||
let execError = "";
|
let execError = "";
|
||||||
@@ -38,35 +59,112 @@ try {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
exec
|
if (fail_ci) {
|
||||||
.exec(
|
exec
|
||||||
"bash",
|
.exec(
|
||||||
["codecov.sh", "-f", `${file}`, "-n", `${name}`, "-F", `${flags}`, '-y', `${yml}`],
|
"bash",
|
||||||
options
|
[
|
||||||
)
|
"codecov.sh",
|
||||||
.then(() => {
|
"-f",
|
||||||
unlinkFile()
|
`${file}`,
|
||||||
});
|
"-n",
|
||||||
|
`${name}`,
|
||||||
|
"-F",
|
||||||
|
`${flags}`,
|
||||||
|
"-y",
|
||||||
|
`${yml}`,
|
||||||
|
"-Z"
|
||||||
|
],
|
||||||
|
options
|
||||||
|
)
|
||||||
|
.catch(err => {
|
||||||
|
core.setFailed(
|
||||||
|
`Codecov failed with the following error: ${err.message}`
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
unlinkFile();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
exec
|
||||||
|
.exec(
|
||||||
|
"bash",
|
||||||
|
[
|
||||||
|
"codecov.sh",
|
||||||
|
"-f",
|
||||||
|
`${file}`,
|
||||||
|
"-n",
|
||||||
|
`${name}`,
|
||||||
|
"-F",
|
||||||
|
`${flags}`,
|
||||||
|
"-y",
|
||||||
|
`${yml}`
|
||||||
|
],
|
||||||
|
options
|
||||||
|
)
|
||||||
|
.catch(err => {
|
||||||
|
core.warning(`Codecov warning: ${err.message}`);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
unlinkFile();
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
exec
|
if (fail_ci) {
|
||||||
.exec(
|
exec
|
||||||
"bash",
|
.exec(
|
||||||
["codecov.sh", "-n", `${name}`, "-F", `${flags}`, '-y', `${yml}`],
|
"bash",
|
||||||
options
|
[
|
||||||
)
|
"codecov.sh",
|
||||||
.then(() => {
|
"-n",
|
||||||
unlinkFile()
|
`${name}`,
|
||||||
});
|
"-F",
|
||||||
|
`${flags}`,
|
||||||
|
"-y",
|
||||||
|
`${yml}`,
|
||||||
|
"-Z"
|
||||||
|
],
|
||||||
|
options
|
||||||
|
)
|
||||||
|
.catch(err => {
|
||||||
|
core.setFailed(
|
||||||
|
`Codecov failed with the following error: ${err.message}`
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
unlinkFile();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
exec
|
||||||
|
.exec(
|
||||||
|
"bash",
|
||||||
|
["codecov.sh", "-n", `${name}`, "-F", `${flags}`, "-y", `${yml}`],
|
||||||
|
options
|
||||||
|
)
|
||||||
|
.catch(err => {
|
||||||
|
core.warning(`Codecov warning: ${err.message}`);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
unlinkFile();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const unlinkFile = () => {
|
const unlinkFile = () => {
|
||||||
fs.unlink("codecov.sh", err => {
|
fs.unlink("codecov.sh", err => {
|
||||||
if (err) throw err;
|
if (err && fail_ci) {
|
||||||
|
throw err;
|
||||||
|
} else if (err) {
|
||||||
|
core.warning(`Codecov warning: ${err.message}`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
if (fail_ci) {
|
||||||
|
core.setFailed(`Codecov failed with the following error: ${error.message}`);
|
||||||
|
} else {
|
||||||
|
core.warning(`Codecov warning: ${error.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+4
-467
File diff suppressed because it is too large
Load Diff
+6
-4
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "test2",
|
"name": "codecov-action",
|
||||||
"version": "1.0.0",
|
"version": "1.0.5",
|
||||||
"description": "[](https://github.com/marketplace/actions/codecov) ### Easily upload coverage reports to Codecov from GitHub Actions",
|
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"build": "ncc build index.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.0",
|
"@actions/core": "^1.2.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
|
"@zeit/ncc": "^0.20.5",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"request": "^2.88.0"
|
"request": "^2.88.0"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user