Compare commits

...
204 Commits
Author SHA1 Message Date
Thomas Hu 5d3f01ccdc Up the number of attempts 2020-08-17 17:14:51 -04:00
Thomas Hu 2d80980946 Add more timeouts and sharter timeout 2020-08-17 17:05:37 -04:00
Thomas Hu fadbb25281 Merge pull request #109 from ibrahim0814/patch-1
Update action.yml with new authors
2020-08-12 13:09:38 -04:00
Ibrahim Ali ad774549da Update action.yml with new authors
Add Thomas Hu as new author 👍
2020-08-12 00:15:12 -07:00
Thomas Hu 07127fde53 Merge pull request #97 from codecov/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2020-07-22 09:57:50 -04:00
dependabot[bot] 9128542d5d Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-17 18:34:08 +00:00
Thomas Hu 6d208f5b52 Merge pull request #96 from codecov/1.0.12
Wrap request promise in try catch
2020-07-17 14:33:32 -04:00
Thomas Hu 8ddda09c14 Wrap request promise in try catch 2020-07-17 11:57:18 -04:00
Thomas Hu e16d515d3b Merge pull request #90 from codecov/directory-and-debug
Add directory and file save
2020-07-13 13:21:09 -04:00
Thomas Hu 6b30325ebb Merge branch 'master' into directory-and-debug 2020-07-13 13:00:02 -04:00
Thomas Hu 95f699a0a9 Merge pull request #94 from codecov/update-readme
Add files to README
2020-07-10 17:53:16 -04:00
Thomas Hu 273443b325 Add files to README 2020-07-10 15:32:51 -04:00
Thomas Hu a258ec8bb8 Merge pull request #93 from codecov/specify-files
Specify files and add testing
2020-07-10 15:31:03 -04:00
Thomas Hu 89692c91b7 Specify files and add testing 2020-07-09 23:07:34 -04:00
Thomas Hu 85ec2c8d83 Add directory and file save 2020-07-07 22:36:09 -04:00
Thomas Hu f3570723ef Merge pull request #89 from codecov/fix-ependency
Fix dependencies
2020-07-01 16:43:21 -04:00
Thomas Hu f40f110376 Try requestretry 2020-07-01 15:47:57 -04:00
Thomas Hu 4f81def87b Upgrade ncc 2020-07-01 15:35:39 -04:00
Thomas Hu ddc46b3107 Fix dependencies 2020-07-01 14:58:11 -04:00
Thomas Hu 1b088680d5 Fix dependencies 2020-07-01 14:48:26 -04:00
Thomas Hu 22f6ff10ac Merge pull request #88 from codecov/update-dist
Update dist
2020-07-01 11:57:59 -04:00
Thomas Hu 0ceca4b5d3 Install dependencies 2020-07-01 11:51:01 -04:00
Thomas Hu 3658bafacb Bump version 2020-07-01 11:45:18 -04:00
Thomas Hu ef3b48314f Update dist 2020-07-01 11:40:05 -04:00
Thomas Hu dbf1ddee08 Merge pull request #87 from codecov/retry-bash
Retry retrieval of bash script
2020-07-01 07:27:35 -04:00
Thomas Hu cc6b0c11d2 Retry retrieval of bash script 2020-06-30 23:33:46 -04:00
Thomas Hu f532c3a145 Merge pull request #64 from samuelcolvin/env-vars
Env vars
2020-05-06 17:35:02 -04:00
Thomas Hu 143333ba90 Merge pull request #67 from alex/patch-1
Fixes #66 -- include the current env when invoking the subprocess
2020-05-06 17:33:54 -04:00
Thomas Hu a50851cfd8 Merge pull request #72 from christophebedard/fix-typo-readme
Fix typo in README
2020-05-06 17:32:30 -04:00
Thomas Hu 6914527afb Update index.js 2020-05-06 17:28:51 -04:00
Christophe Bedard fff75f1901 Fix typo in README 2020-05-03 10:22:07 -04:00
Samuel Colvin 1804a456ff fix typos 2020-04-04 14:01:58 +01:00
Alex Gaynor d1b4c72fc5 Update index.js 2020-03-21 20:47:24 -04:00
Alex Gaynor 6fd09f835d Fixes #66 -- include the current env when invoking the subprocess 2020-03-21 20:47:04 -04:00
Samuel Colvin e866b3854d add docs 2020-03-20 16:05:53 +00:00
Samuel Colvin 608816e426 remove log statements 2020-03-20 11:27:29 +00:00
Samuel Colvin 2ce3b3807d rebuild dist 2020-03-20 11:21:50 +00:00
Samuel Colvin 0e6a911c9b add '-e' flag 2020-03-19 16:46:53 +00:00
Samuel Colvin d04135f7cf debug log 2020-03-19 16:39:42 +00:00
Samuel Colvin 7938e79f4c adding 'env_vars' input option 2020-03-19 16:31:53 +00:00
Ibrahim Ali a3a6becb2c Update README.md 2020-03-07 00:00:34 -08:00
Ibrahim Ali bf0e754c09 Update README.md 2020-03-07 00:00:14 -08:00
Ibrahim Ali daa5098552 update latest version line on readme 2020-03-06 23:59:58 -08:00
Ibrahim Ali 71d5dea6af Add example for how to specify multiple flags 2020-03-05 00:00:10 -08:00
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
ibrahim0814 e6cea4aaed update readme 2019-11-19 04:18:00 -08:00
ibrahim0814 70f2402e00 Merge branch 'node-action' of github.com:codecov/codecov-action into node-action 2019-11-19 04:06:13 -08:00
ibrahim0814 e6af53269a rem node modules, add gitignore, dist folder 2019-11-19 04:05:04 -08:00
Ibrahim Ali 7ab923356b Merge branch 'master' into node-action 2019-11-19 03:38:12 -08:00
ibrahim0814 8676a5a946 update readme, contributing, and add yml input 2019-11-19 03:36:06 -08:00
ibrahim0814 6afe2e0d90 fix logic 2019-11-19 00:28:57 -08:00
ibrahim0814 67a2282699 clean up, add other inputs 2019-11-19 00:24:27 -08:00
ibrahim0814 e1a57b8a47 try using user supplied token 2019-11-18 23:56:52 -08:00
ibrahim0814 1be0517b99 try saving bash script as file 2019-11-18 23:39:04 -08:00
ibrahim0814 889584d6f9 try using actions exec 2019-11-18 22:51:40 -08:00
ibrahim0814 c4ca0425e1 try synchronous process instead of async 2019-11-18 14:41:41 -08:00
Ibrahim Ali 8d062b28e1 Add if conditional in example for linux 2019-11-17 10:35:11 -08:00
ibrahim0814 a3ae14ab33 add env vars 2019-11-14 01:29:03 -08:00
ibrahim0814 1259587051 output 2019-11-14 01:12:21 -08:00
ibrahim0814 dd61d9f90b rem extra files 2019-11-14 01:05:31 -08:00
ibrahim0814 6e83ad2f33 rm first 8 lines of code 2019-11-14 01:04:58 -08:00
ibrahim0814 747c905e39 more output 2019-11-14 00:47:48 -08:00
ibrahim0814 29e36a5e71 try exec file 2019-11-14 00:43:05 -08:00
ibrahim0814 f0ee262b3a try exec file 2019-11-14 00:29:39 -08:00
ibrahim0814 bab0bf56a8 try 2 replacing pipe line 2019-11-14 00:16:42 -08:00
ibrahim0814 efc5cbe89b try removing pipefail line 2019-11-14 00:10:36 -08:00
ibrahim0814 3d61f3d4c8 correct docker to node12 2019-11-13 23:44:35 -08:00
ibrahim0814 db0171f588 try with exec sh 2019-11-13 23:41:15 -08:00
Ibrahim Ali 7ba41fc0d6 update readme to reflect linux support only 2019-11-11 10:04:33 -08:00
Ibrahim Ali d5749ba79a change token requirement to true 2019-10-17 12:32:14 -07:00
Ibrahim Ali b4c0b83601 update docs to v1.0.3 2019-10-17 12:24:24 -07:00
Ibrahim Ali 3cde50f4f1 Update main.yml 2019-10-17 12:06:53 -07:00
Ibrahim Ali 10e590a5de Update main.yml 2019-10-17 12:04:46 -07:00
Ibrahim Ali af19dcb193 Merge pull request #26 from teohhanhui/fix/shell-command-issues
Fix shell command issues
2019-10-17 11:56:14 -07:00
Teoh Han Hui 77e74f257f Fix shell command issues 2019-10-11 20:13:30 +02:00
Ibrahim Ali 1c4a4261fa update installation docs to latest MP version 2019-08-25 14:50:59 -07:00
Joe Becher cb218a0977 Merge pull request #10 from codecov/drazisil-patch-1
install git and mercurial
2019-08-24 13:14:58 -04:00
Joe Becher e78f79e460 install git and mercurial 2019-08-24 13:13:04 -04:00
Joe Becher 899e5c913e Merge pull request #9 from codecov/drazisil-patch-1
Repo now self-tests
2019-08-24 12:52:45 -04:00
Joe Becher 886c7c8bc8 Don't need sudo 2019-08-24 12:39:08 -04:00
Joe Becher 75d10d924b Install curl 2019-08-24 12:37:54 -04:00
Joe Becher e61b738355 no need for apk 2019-08-24 12:36:15 -04:00
Joe Becher cbad155b75 use ubuntu 2019-08-24 12:34:36 -04:00
Joe Becher 9e1c456662 Update main.yml 2019-08-24 12:32:59 -04:00
Joe Becher 392e5b2711 does this work? 2019-08-24 12:29:34 -04:00
Joe Becher bd5538d84a add slash 2019-08-24 12:27:33 -04:00
Joe Becher 9d47efe7b9 local tests 2019-08-24 12:24:31 -04:00
Thomas Hu 6aa7ac1896 Merge pull request #8 from codecov/support-alpine
Update bash entrypoint
2019-08-24 11:38:00 -04:00
Thomas Hu c2a68071b3 Update bash entrypoint 2019-08-24 11:29:05 -04:00
Ibrahim Ali 8273bebacc correct installation line org to codecov 2019-08-15 21:28:17 -07:00
Ibrahim Ali 6728012add add marketplace flag 2019-08-08 14:59:24 -07:00
Ibrahim Ali e3f7b8baf8 Update README.md 2019-08-08 10:10:05 -07:00
“ibrahim0814” 4af6f0743e delete debug output 2019-08-08 09:42:59 -07:00
“ibrahim0814” 5c880506b5 env vars 2019-08-08 09:22:55 -07:00
“ibrahim0814” a3a7edcc61 revert back to original 2019-08-08 09:21:49 -07:00
“ibrahim0814” f93f6bdcae test env var 2019-08-08 08:39:08 -07:00
“ibrahim0814” 35b9267ca9 check what shows up for env 2019-08-08 08:24:15 -07:00
“ibrahim0814” 39a99a4e84 test ci env var 2019-08-08 08:19:32 -07:00
“ibrahim0814” e0cc6d49d9 readme 2019-08-07 23:46:42 -07:00
“ibrahim0814” 96d1c9a15d readme 2019-08-07 23:44:17 -07:00
“ibrahim0814” ee0d391ad0 clean up comments 2019-08-07 23:40:42 -07:00
“ibrahim0814” bd3230c275 correct logic for token requirement 2019-08-07 23:00:45 -07:00
Ibrahim Ali c7a04fdde5 Merge pull request #3 from codecov/thomasrockhu-patch-1
Better error message
2019-08-07 22:43:29 -07:00
Thomas Hu efe83d2996 Revert "Remove options without a provided token"
This reverts commit db5a766c55.
2019-08-08 01:42:54 -04:00
Thomas Hu db5a766c55 Remove options without a provided token
Remove options without a token
2019-08-08 01:39:13 -04:00
Thomas Hu 1f99174e83 Better error message 2019-08-08 01:36:45 -04:00
“ibrahim0814” 93d126a749 readme 2019-08-07 22:15:28 -07:00
“ibrahim0814” 4546e138ba readme 2019-08-07 21:47:36 -07:00
“ibrahim0814” 125cedf806 readme 2019-08-07 21:45:22 -07:00
“ibrahim0814” 6f489c7a78 readme 2019-08-07 21:44:55 -07:00
“ibrahim0814” fc175be7b5 readme 2019-08-07 21:43:58 -07:00
“ibrahim0814” a166a95c4a readme 2019-08-07 21:40:59 -07:00
“ibrahim0814” dd94ace224 add contributing section 2019-08-07 21:38:13 -07:00
“ibrahim0814” a8f7ad31ff readme 2019-08-07 21:33:14 -07:00
“ibrahim0814” ed370e2ded readme 2019-08-07 21:30:18 -07:00
“ibrahim0814” dd098b2f6b shift to token required 2019-08-07 21:20:10 -07:00
“ibrahim0814” d2c4464978 readme 2019-08-07 21:03:14 -07:00
“ibrahim0814” 97fe500537 readme 2019-08-07 21:02:44 -07:00
“ibrahim0814” 111c74ca11 readme 2019-08-07 20:56:18 -07:00
“ibrahim0814” edbb6f8e5d rem header comments 2019-08-07 20:41:31 -07:00
“ibrahim0814” 7d121a89c0 rem header comments 2019-08-07 20:40:25 -07:00
“ibrahim0814” 159fdf6e54 modify input description 2019-08-07 20:36:21 -07:00
“ibrahim0814” 4fb042f123 readme 2019-08-07 20:26:06 -07:00
“ibrahim0814” 0766dd1553 readme 2019-08-07 20:24:56 -07:00
“ibrahim0814” e0683efc0b add header comments 2019-08-07 20:21:41 -07:00
“ibrahim0814” 1b38d5e8b4 readme 2019-08-07 20:10:44 -07:00
“ibrahim0814” 2793f27b99 readme 2019-08-07 20:07:45 -07:00
“ibrahim0814” afda60d339 readme 2019-08-07 19:41:47 -07:00
“ibrahim0814” f21e0e6d14 readme 2019-08-07 19:33:51 -07:00
“ibrahim0814” 55d06088fa readme 2019-08-07 19:29:56 -07:00
“ibrahim0814” 7461079497 readme 2019-08-07 19:29:11 -07:00
“ibrahim0814” eda3e0f75c readme 2019-08-07 19:28:35 -07:00
“ibrahim0814” c7f04ba6f0 readme 2019-08-07 19:27:57 -07:00
“ibrahim0814” 67896f6476 readme 2019-08-07 19:25:37 -07:00
“ibrahim0814” 1e6057f6d0 readme 2019-08-07 19:24:28 -07:00
“ibrahim0814” 25df614d11 readme 2019-08-07 19:23:31 -07:00
“ibrahim0814” 3ee0aad0bf readme 2019-08-07 19:18:32 -07:00
“ibrahim0814” 93ee40a7a2 readme 2019-08-07 19:17:51 -07:00
“ibrahim0814” d1914c14b8 move arguments section up 2019-08-07 18:44:06 -07:00
“ibrahim0814” c2703ce7b6 readme 2019-08-07 18:40:03 -07:00
“ibrahim0814” 47224ae4e6 readme 2019-08-07 18:38:52 -07:00
“ibrahim0814” 413e76629d add argument uage 2019-08-07 18:35:56 -07:00
“ibrahim0814” 6625b1305d add name documentation info 2019-08-07 18:30:01 -07:00
“ibrahim0814” 77578a4d61 remove debug statements 2019-08-07 18:21:36 -07:00
“ibrahim0814” 2ce8445bdf puts docker args back in 2019-08-07 18:16:19 -07:00
“ibrahim0814” 22e73b5938 empty args list 2019-08-07 18:14:12 -07:00
“ibrahim0814” f338553518 test without args 2019-08-07 18:11:55 -07:00
“ibrahim0814” 2ca1146dfd test token arg 2019-08-07 18:09:32 -07:00
“ibrahim0814” e49c256d4a try using no args 2019-08-07 18:05:04 -07:00
“ibrahim0814” baf6a7af4f fix yml error try 2 2019-08-07 17:04:13 -07:00
“ibrahim0814” d2db6055ff Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 16:45:37 -07:00
“ibrahim0814” 9aebf8f59e add name input with debug cmds 2019-08-07 16:42:40 -07:00
Ibrahim Ali e74d307e33 Update README.md 2019-08-07 13:19:04 -07:00
Ibrahim Ali 55c9c61f7e Update README.md 2019-08-07 13:17:40 -07:00
“ibrahim0814” e749576e48 Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 13:10:14 -07:00
“ibrahim0814” 4a87a38546 remove debug statements 2019-08-07 13:09:57 -07:00
Ibrahim Ali d7c531ac59 add flags documentation 2019-08-07 13:08:23 -07:00
“ibrahim0814” b8cc1b68aa add debug statements 2019-08-07 12:42:49 -07:00
“ibrahim0814” 1cb9bf4ff5 add flags 2019-08-07 12:34:25 -07:00
17 changed files with 59957 additions and 68 deletions
+19
View File
@@ -0,0 +1,19 @@
name: Workflow for Codecov Action
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install dependencies
run: npm install
- name: Run tests and collect coverage
run: yarn run test-all
- name: Upload coverage to Codecov
uses: ./
with:
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
file: ./coverage/coverage-final.json
flags: unittest
name: codecov-1
+95
View File
@@ -0,0 +1,95 @@
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# react / gatsby
public/
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# macOS Finder metadata
.DS_Store
+3 -3
View File
@@ -6,8 +6,8 @@ The following is a set of guidelines for contributing to this repository, which
## What does this repo do?
This repo is a GitHub Action, meaning it integrates with the GitHub Actions CI/CD pipeline. It's meant to take formatted reports with code coverage stats and upload them to codecov.io. What's essentially happening in the background is that Actions is spinning up a Linux Docker container with the contents of this repository. Inside that container, we then call a shell scipt that runs Codecov's Bash uploader.
This repo is a GitHub Action, meaning it integrates with the GitHub Actions CI/CD pipeline. It's meant to take formatted reports with code coverage stats and upload them to codecov.io. Our Node action uses the Actions toolkit to make system calls that allow us to run Codecov's bash uploader inside of Node. Essentially what we're doing in this action is downloading Codecov's bash uploader script from codecov.io/bash, saving it as a file in the current directory, executing the file via `exec` calls, then removing the script from the current directory.
## PRs and Support
## PRs, Issues, and Support
Feel free to clone, modify code and request a PR to this repository. All PRs will be reviewed by the Codecov team. If your PR has been sitting for a while or if you have any questions, ping us at support@codecov.io
Feel free to clone, modify code and request a PR to this repository. All PRs and issues will be reviewed by the Codecov team. If your PR/issue has been sitting for a while or if you have any questions, ping us at support@codecov.io
-10
View File
@@ -1,10 +0,0 @@
FROM alpine:3.10
WORKDIR /app
COPY . /app
RUN apk add --no-cache curl bash git
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT [ "/app/entrypoint.sh" ]
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 Codecov
Copyright (c) 2019-2020 Codecov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+58 -25
View File
@@ -1,21 +1,49 @@
<!-- <p align="center"><img src="./codecov-logo.png" /></p> -->
# Codecov GitHub Action
### Easily upload coverage reports to Codecov from GitHub Actions
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov)
### Easily upload coverage reports to Codecov from GitHub Actions
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
## Usage
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v1` is recommended) as a `step` within your `workflow.yml` file.
If you have a *private repository*, this Action also requires you to [provide an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) from [codecov.io](https://www.codecov.io) (tip: in order to avoid exposing your token, store it as a `secret`). Optionally, you can choose to include up to four additional inputs to customize the upload context. **For public repositories, no token is needed**
Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/codecov-action@v0.3
- uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}} #for private repos
file: ./coverage.xml #optional
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ./coverage.xml # optional
files: ./coverage1.xml,./coverage2.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
```
>**Note**: This assumes that you've set your Codecov token inside settings > secrets as `CODECOV_TOKEN`. If not, you can get an upload token for your specific repo on codecov.io. A token is *not* required for public repositories.
>**Note**: This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are *not* available to forks of repositories.
## Arguments
Codecov's Action currently supports five inputs from the user: `token`, `file`, `flags`,`name`, and `fail_ci_if_error`. These inputs, along with their descriptions and usage contexts, are listed in the table below:
>**Update**: We've removed the `yml` parameter with the latest release of this action. Please put your custom codecov yaml file at the root of the repo because other locations will no longer be supported in the future.
| Input | Description | Usage |
| :---: | :---: | :---: |
| `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
| `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
| `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
| `path_to_write_report` | Write upload file to path before uploading | Optional
### Example `workflow.yml` with Codecov Action
@@ -24,36 +52,41 @@ name: Example workflow for Codecov
on: [push]
jobs:
run:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
PYTHON: '3.7'
steps:
- uses: actions/checkout@master
- name: Setup Python
- name: Setup Python
uses: actions/setup-python@master
with:
version: 3.7
python-version: 3.7
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v0.2
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
files: ./coverage1.xml,./coverage2.xml
directory: ./coverage/reports/
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
path_to_write_report: ./coverage/codecov_report.gz
```
## Contributing
## Arguments
Contributions are welcome! Check out the [Contribution Guide](CONTRIBUTING.md).
| Argument | Description |
| :---: | :---: |
| `token` | Used to authorize coverage report uploads |
| `file` | Location of the coverage report |
## License
## License
The code in this project is released under the [MIT License](LICENSE)
The code in this project is released under the [MIT License](LICENSE).
+29 -11
View File
@@ -1,19 +1,37 @@
name: 'Codecov'
description: 'GitHub action that uploads coverage reports for your repository to codecov.io'
author: 'Ibrahim Ali @ Codecov'
inputs:
description: 'GitHub Action that uploads coverage reports for your repository to codecov.io'
author: 'Ibrahim Ali <@ibrahim0814> & Thomas Hu <@thomasrockhu> | Codecov'
inputs:
name:
description: 'User defined upload name. Visible in Codecov UI'
required: false
token:
description: 'Set the repository token'
required: false
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
files:
description: 'Comma-separated list of files to upload'
required: false
directory:
description: 'Directory to search for coverage reports.'
required: false
flags:
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
required: false
path_to_write_report:
description: 'Write upload file to path before uploading'
required: false
env_vars:
description: 'Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)'
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:
color: 'red'
color: 'red'
icon: 'umbrella'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.token }}
- ${{ inputs.file }}
using: 'node12'
main: 'dist/index.js'
+54234
View File
File diff suppressed because one or more lines are too long
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
set -eu
if [ $# -eq 0 ]
then
bash <(curl -s https://codecov.io/bash)
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE
elif [ "x$INPUT_TOKEN" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN
elif [ "x$INPUT_FILE" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -f $INPUT_FILE
fi
+165
View File
@@ -0,0 +1,165 @@
const core = require("@actions/core");
const exec = require("@actions/exec");
const fs = require("fs");
const request = require('requestretry');
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 files = core.getInput("files");
const env_vars = core.getInput("env_vars");
const dir = core.getInput("directory");
const write_path = core.getInput("path_to_write_report");
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({
json: false,
maxAttempts: 10,
timeout: 3000,
url: "https://codecov.io/bash"
}, (error, response, body) => {
try {
if (error && fail_ci) {
throw error;
} else if (error) {
core.warning(`Codecov warning: ${error.message}`);
}
fs.writeFile("codecov.sh", body, err => {
if (err && fail_ci) {
throw err;
} else if (err) {
core.warning(`Codecov warning: ${err.message}`);
}
let output = "";
let execError = "";
const options = {};
options.listeners = {
stdout: data => {
output += data.toString();
},
stderr: data => {
execError += data.toString();
}
};
options.env = Object.assign(process.env, {
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_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"];
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}`
);
}
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 && fail_ci) {
throw err;
} else if (err) {
core.warning(`Codecov warning: ${err.message}`);
}
});
};
});
} catch (error) {
core.setFailed(
`Codecov failed with the following error: ${error.message}`
);
}
});
} catch (error) {
if (fail_ci) {
core.setFailed(`Codecov failed with the following error: ${error.message}`);
} else {
core.warning(`Codecov warning: ${error.message}`);
}
}
+4
View File
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
}
+5257
View File
File diff suppressed because it is too large Load Diff
+39
View File
@@ -0,0 +1,39 @@
{
"name": "codecov-action",
"version": "1.0.13",
"description": "Upload coverage reports to Codecov from GitHub Actions",
"main": "index.js",
"scripts": {
"test": "jest --coverage",
"test-calculator": "jest --testPathPattern=src/calculator/ --coverage --coverageDirectory=coverage/calculator",
"test-index": "jest --testPathPattern=src/index --coverage --coverageDirectory=coverage/index",
"test-all": "yarn run test && yarn run test-calculator && yarn run test-index",
"build": "ncc build index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/codecov/codecov-action.git"
},
"keywords": [],
"author": "Ibrahim Ali",
"license": "MIT",
"bugs": {
"url": "https://github.com/codecov/codecov-action/issues"
},
"homepage": "https://github.com/codecov/codecov-action#readme",
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.1",
"@types/jest": "^26.0.4",
"@zeit/ncc": "^0.22.3",
"fs": "0.0.1-security",
"jest": "^26.1.0",
"jest-junit": "^10.0.0",
"request": "^2.88.0",
"requestretry": "^4.1.1",
"ts-jest": "^26.1.1",
"typescript": "^3.9.6",
"yarn": "^1.22.4"
},
"devDependencies": {}
}
+11
View File
@@ -0,0 +1,11 @@
import Calculator from './calculator'
test('adds 2 + 3 to equal 5', () => {
const calc = new Calculator()
expect(calc.add(2, 3)).toBe(5);
});
test('subtracts 2 - 3 to equal -1', () => {
const calc = new Calculator()
expect(calc.subtract(2, 3)).toBe(-1);
});
+10
View File
@@ -0,0 +1,10 @@
export default class Calculator {
add(x : number, y : number) : number {
return x + y;
}
subtract(x: number, y: number) : number {
return x - y;
}
}
+11
View File
@@ -0,0 +1,11 @@
import Index from "./index";
test('test uncovered if', () => {
const indexObj = new Index();
expect(indexObj.uncovered_if()).toEqual(false);
});
test('fully covered', () => {
const indexObj = new Index();
expect(indexObj.fully_covered()).toEqual(true);
});
+21
View File
@@ -0,0 +1,21 @@
export default class Index {
//This function is tested and part of it is uncovered
uncovered_if = (a = true) => {
if (a == true) {
return false
} else {
return true
}
}
//This function will be fully covered
fully_covered = () => {
return true
}
//This function will not be tested by unit tests
uncovered = () => {
return true
}
}