Compare commits

...
46 Commits
Author SHA1 Message Date
ibrahim0814 e34ee48524 remove sample coverage file 2020-03-04 22:37:01 -08:00
Ibrahim Ali d7c91c57ee Merge pull request #53 from armano2/branch-support
Add support for pull requests and tokenless uploads
2020-03-04 22:24:12 -08:00
ibrahim0814 d9faadf52a more documentation updates 2020-03-04 22:22:38 -08:00
ibrahim0814 c70450d006 revert alt exec cmd 2020-03-04 22:02:07 -08:00
ibrahim0814 a6d365dd4c syntax error fix 2020-03-04 21:59:13 -08:00
ibrahim0814 94278ffe1b test alternate exec cmd 2020-03-04 21:57:29 -08:00
ibrahim0814 ebea5cacdf add more documentation notes 2020-03-04 19:59:17 -08:00
ibrahim0814 6a65fa4d50 add github run id env variable 2020-03-04 19:11:12 -08:00
ibrahim0814 4623a4dc3d add sample coverage files 2020-03-04 18:55:36 -08:00
ibrahim0814 c98408608b add functionality for tokenless 2020-03-04 18:30:14 -08:00
ibrahim0814 49c86d6a5f remove mention of yaml parameter 2020-03-04 18:02:42 -08:00
Armano 6ec347819d chore: set GITHUB_HEAD_REF to empty string if not present 2020-02-09 23:38:15 +01:00
Armano 44ca3d2c84 simplify code and add missing GITHUB_HEAD_REF 2020-02-07 22:24:55 +01:00
Ibrahim Ali 66879ff350 add forked repo secrets notice to readme 2019-12-18 18:50:35 -08:00
ibrahim0814 797e92895e del workflow file 2019-12-05 22:50:23 -08:00
ibrahim0814 a6337803aa del workflow file 2019-12-05 22:48:47 -08:00
Ibrahim Ali 2613f978c9 update marketplace version 2019-12-05 22:45:35 -08:00
Ibrahim Ali 4c6a7296af comment out for now 2019-12-05 22:45:10 -08:00
Ibrahim Ali 4fec3dfa96 Merge pull request #41 from codecov/add-fail-input
Add input to fail ci build
2019-12-05 22:27:09 -08:00
ibrahim0814 355d574b25 add release yml, add build script in pkg json 2019-12-05 22:19:41 -08:00
ibrahim0814 a497b16d77 fix action yaml description 2019-12-05 21:42:20 -08:00
ibrahim0814 ab46201142 run ncc build again 2019-12-05 21:40:52 -08:00
ibrahim0814 ecf5f576a0 prettify 2019-12-05 20:18:23 -08:00
ibrahim0814 8c950ae5c5 add additional catch blocks, correct link func 2019-12-05 20:15:25 -08:00
ibrahim0814 3d303911df add additional catch blocks, correct link func 2019-12-05 20:10:44 -08:00
ibrahim0814 eb1ea256cb test bad unlink 2019-12-05 19:54:02 -08:00
ibrahim0814 5f55456d46 remove catch block 2019-12-05 19:44:49 -08:00
ibrahim0814 ade1ebf812 add catch block 2019-12-05 18:38:48 -08:00
ibrahim0814 31d7d88849 test bad request 2019-12-05 18:31:47 -08:00
ibrahim0814 d608de8763 ncc build 2019-12-05 18:25:41 -08:00
ibrahim0814 08a0ecb0f3 set ci fail conditions 2019-12-05 18:25:24 -08:00
ibrahim0814 3dfea70b3f prettify rem extra catch block 2019-12-05 16:43:29 -08:00
ibrahim0814 f291e7ca9d revert back to set failed 2019-12-05 16:05:56 -08:00
ibrahim0814 78d806df69 replace set fail with warning 2019-12-05 15:48:29 -08:00
ibrahim0814 dd4242c61d add warning instead of fail condition 2019-12-05 14:01:30 -08:00
ibrahim0814 fc0e9fde50 add catch block 2019-12-05 13:46:50 -08:00
ibrahim0814 cf0e744e2c const to let 2019-12-05 01:20:56 -08:00
ibrahim0814 fd07c5fc0c redo dist cmd 2019-12-05 01:18:40 -08:00
ibrahim0814 3d11715b9e initial 2019-12-05 00:57:51 -08:00
Ibrahim Ali cec654a0a7 Merge pull request #39 from bendichter/patch-1
fix python-version in example workflow.yml
2019-12-01 21:15:04 -08:00
Ben Dichter 41a31f1ccf fix python-version in example workflow.yml
I had to change this
2019-12-01 13:41:06 -05:00
Ibrahim Ali d073b23c28 Merge pull request #38 from dguo/remove-ds-store
Remove the .DS_Store file
2019-11-30 16:59:15 -08:00
Danny Guo 11d69070bf Remove the .DS_Store file 2019-11-30 14:14:06 -05:00
Ibrahim Ali dd2a59ac10 update readme 2019-11-20 13:00:29 -08:00
Ibrahim Ali 3ec2345d08 update readme 2019-11-19 11:26:54 -08:00
Ibrahim Ali aea83764c6 Merge pull request #33 from codecov/node-action
Convert action from docker to javascript
2019-11-19 04:29:27 -08:00
9 changed files with 24029 additions and 24406 deletions
Vendored
BIN
View File
Binary file not shown.
+3 -12
View File
@@ -1,23 +1,14 @@
name: Example workflow for Codecov
on: [push]
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# - name: Setup Python
# uses: actions/setup-python@master
# - name: Generate coverage report
# run: |
# pip install pytest
# pip install pytest-cov
# pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: ./
with:
token: ${{secrets.CODECOV_TOKEN}}
#commenting out token because tokenless uploads are now supported
#token: ${{secrets.CODECOV_TOKEN}}
flags: unittest
name: codecov-1
+5 -2
View File
@@ -76,7 +76,7 @@ typings/
# nuxt.js build output
.nuxt
# react / gatsby
# react / gatsby
public/
# vuepress build output
@@ -89,4 +89,7 @@ public/
.fusebox/
# DynamoDB Local files
.dynamodb/
.dynamodb/
# macOS Finder metadata
.DS_Store
+21 -16
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -6,16 +6,16 @@ inputs:
description: 'User defined upload name. Visible in Codecov UI'
required: false
token:
description: 'Repository upload token - get it from codecov.io'
required: true
description: 'Repository upload token - get it from codecov.io. Required only for private repositories'
required: false
file:
description: 'Path to coverage file to upload'
required: false
flags:
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
required: false
yml:
description: 'Specify the location of the .codecov.yml config file'
fail_ci_if_error:
description: 'Specify whether or not CI build should fail if Codecov runs into an error during upload'
required: false
branding:
color: 'red'
+23908 -23866
View File
File diff suppressed because one or more lines are too long
+72 -30
View File
@@ -3,19 +3,39 @@ const exec = require("@actions/exec");
const request = require("request");
const fs = require("fs");
let fail_ci;
try {
const name = core.getInput("name");
const token = core.getInput("token");
const flags = core.getInput("flags");
const file = core.getInput("file");
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) => {
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 => {
if (err) throw err;
if (err && fail_ci) {
throw err;
} else if (err) {
core.warning(`Codecov warning: ${err.message}`);
}
let output = "";
let execError = "";
@@ -30,43 +50,65 @@ try {
};
options.env = {
CODECOV_TOKEN: `${token}`,
GITHUB_ACTION: process.env.GITHUB_ACTION,
GITHUB_RUN_ID: process.env.GITHUB_RUN_ID,
GITHUB_REF: process.env.GITHUB_REF,
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY,
GITHUB_SHA: process.env.GITHUB_SHA
GITHUB_SHA: process.env.GITHUB_SHA,
GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF || ''
};
if (file) {
exec
.exec(
"bash",
["codecov.sh", "-f", `${file}`, "-n", `${name}`, "-F", `${flags}`, '-y', `${yml}`],
options
)
.then(() => {
unlinkFile()
});
} else {
exec
.exec(
"bash",
["codecov.sh", "-n", `${name}`, "-F", `${flags}`, '-y', `${yml}`],
options
)
.then(() => {
unlinkFile()
});
if(token){
options.env.CODECOV_TOKEN = token
}
const execArgs = ["codecov.sh"];
if (file) {
execArgs.push(
"-f", `${file}`
);
}
execArgs.push(
"-n", `${name}`,
"-F", `${flags}`
);
if (fail_ci) {
execArgs.push(
"-Z"
);
}
exec.exec("bash", execArgs, options)
.catch(err => {
if (fail_ci) {
core.setFailed(
`Codecov failed with the following error: ${err.message}`
);
} else {
core.warning(`Codecov warning: ${err.message}`);
}
})
.then(() => {
unlinkFile();
});;
const unlinkFile = () => {
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) {
core.setFailed(error.message);
if (fail_ci) {
core.setFailed(`Codecov failed with the following error: ${error.message}`);
} else {
core.warning(`Codecov warning: ${error.message}`);
}
}
+6 -469
View File
File diff suppressed because it is too large Load Diff
+10 -7
View File
@@ -1,18 +1,19 @@
{
"name": "test2",
"version": "1.0.0",
"description": "[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1.0.3-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov) ### Easily upload coverage reports to Codecov from GitHub Actions",
"name": "codecov-action",
"version": "1.0.5",
"description": "Upload coverage reports to Codecov from GitHub Actions",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "ncc build index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/codecov/codecov-action.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"author": "Ibrahim Ali",
"license": "MIT",
"bugs": {
"url": "https://github.com/codecov/codecov-action/issues"
},
@@ -20,7 +21,9 @@
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.1",
"@zeit/ncc": "^0.20.5",
"fs": "0.0.1-security",
"request": "^2.88.0"
}
},
"devDependencies": {}
}