@@ 25,6 25,8 @@ function parsePromise(filename) {
function main(config) {
const target = new URL(`${config.repo}/${config.branch}/coverage`, config.server);
+ log.info(`reading LCOV info from ${config.info_filename}`);
+
return parsePromise(config.info_filename).then(data => {
const summary = {
lines: getPercentage(data, "lines"),
@@ 32,6 34,7 @@ function main(config) {
};
log.info("info file parsed", {summary});
+ log.info(`upload summary to ${target}`);
return fetch(target, {
method: 'POST',
headers: {
@@ 58,12 61,12 @@ function main(config) {
}
main({
- server: process.env.DRONECOV_SERVER,
+ server: process.env.PLUGIN_SERVER,
repo: process.env.DRONE_REPO,
branch: process.env.DRONE_COMMIT_BRANCH,
- token: process.env.DRONECOV_ACCESS_TOKEN,
+ token: process.env.PLUGIN_ACCESS_TOKEN,
build_number: process.env.DRONE_BUILD_NUMBER,
- info_filename: process.env.DRONECOV_INFO_FILE,
+ info_filename: process.env.PLUGIN_LCOV_INFO,
}).catch((error) => {
log.error('Failed to upload coverage info', {error});
process.exit(1);