Compare commits

..

23 Commits

Author SHA1 Message Date
Tom Hu
7648985a72 var to arg 2020-12-21 16:25:57 -05:00
Tom Hu
ec4c4ecb5a fail_ci_if_error 2020-12-21 16:25:03 -05:00
Tom Hu
ffd79df3ec working-directory 2020-12-21 16:23:41 -05:00
Tom Hu
a5c8752567 Add in isTrue 2020-12-21 16:22:17 -05:00
Tom Hu
428cd7ca3d Update index.js 2020-12-21 16:21:41 -05:00
Tom Hu
035df630e7 Add package-lock.json 2020-12-21 16:20:17 -05:00
Tom Hu
33f1d301f6 Add test for working dir 2020-12-21 16:19:17 -05:00
Tom Hu
5b42a305f9 Merge pull request #179 from codecov/dependabot/npm_and_yarn/typescript-4.1.3
Bump typescript from 4.1.2 to 4.1.3
2020-12-21 16:13:42 -05:00
Tom Hu
29c457e537 Merge pull request #187 from codecov/dependabot/npm_and_yarn/node-notifier-8.0.1
[Security] Bump node-notifier from 8.0.0 to 8.0.1
2020-12-21 16:13:24 -05:00
dependabot-preview[bot]
b3ee0b08ef [Security] Bump node-notifier from 8.0.0 to 8.0.1
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1. **This update includes a security fix.**
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-21 16:44:47 +00:00
Tom Hu
133f89a6b7 Merge pull request #185 from codecov/makefile
Actually have a makefile
2020-12-21 09:24:14 -05:00
Tom Hu
a03d57cdbd Actually have a makefile 2020-12-21 09:05:03 -05:00
Tom Hu
1fc7722ded Merge pull request #184 from codecov/makefile
Add automations ensure proper builds and deployments | Fix verbose flag
2020-12-21 08:57:25 -05:00
Tom Hu
08574d831c Add dist file 2020-12-20 17:04:06 -05:00
Tom Hu
0c1af46295 Update install script 2020-12-20 17:03:30 -05:00
Tom Hu
f8c87eb84e Update changelog 2020-12-20 17:02:09 -05:00
Tom Hu
8b988c28b0 Fix verbose flag 2020-12-20 17:01:12 -05:00
Tom Hu
4686d7034c Udpate CHANGELOG 2020-12-20 16:59:47 -05:00
Tom Hu
4ef30f27a0 Update changelog 2020-12-20 16:59:07 -05:00
Tom Hu
58cd650984 Update package-lock 2020-12-20 16:58:24 -05:00
Tom Hu
efb844969e force 2020-12-20 16:57:50 -05:00
Tom Hu
c6de3f8548 Add makefile and automations 2020-12-20 16:57:08 -05:00
dependabot-preview[bot]
11de6e2a71 Bump typescript from 4.1.2 to 4.1.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 07:09:15 +00:00
9 changed files with 125 additions and 58 deletions

View File

@@ -13,15 +13,26 @@ jobs:
- name: Upload coverage to Codecov
uses: ./
with:
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
fail_ci_if_error: true
file: ./coverage/coverage-final.json
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
flags: unittest
name: codecov-1
- name: Upload coverage to Codecov (verbose)
uses: ./
with:
fail_ci_if_error: true
file: ./coverage/coverage-final.json
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
flags: unittest
name: codecov-1
verbose: true
- name: Upload coverage to Codecov (working_dir)
uses: ./
with:
fail_ci_if_error: true
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
file: ./coverage/coverage-final.json
flags: unittest
name: codecov-1
verbose: true
working-directory: src/

View File

@@ -1,3 +1,9 @@
### 1.1.1
#### Fixes
- #184 Add automations ensure proper builds and deployments
- #184 Fixes verbose flag
### 1.1.0
#### Features

7
Makefile Normal file
View File

@@ -0,0 +1,7 @@
deploy:
$(eval VERSION := $(shell cat package.json | grep '"version": ' | cut -d\" -f4))
git tag -d v1
git push origin :v1
git tag v1
git tag v$(VERSION) -m ""
git push origin --tags

48
dist/index.js vendored
View File

@@ -2519,8 +2519,19 @@ const exec = __webpack_require__(986);
const fs = __webpack_require__(747);
const request = __webpack_require__(335);
let fail_ci;
try {
const isTrue = arg => {
const lowerVar = arg.toLowerCase();
return (
arg === "yes" ||
arg === "y" ||
arg === "true" ||
arg === "t" ||
arg === "1"
) ? true : false;
}
const name = core.getInput("name");
const token = core.getInput("token");
const flags = core.getInput("flags");
@@ -2529,21 +2540,12 @@ try {
const env_vars = core.getInput("env_vars");
const dir = core.getInput("directory");
const write_path = core.getInput("path_to_write_report");
const verbose = core.getInput("verbose");
const working_dir = core.getInput("working-directory");
const xcode_derived_data = core.getInput("xcode_derived_data");
const xcode_package = core.getInput("xcode_package");
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;
}
const fail_ci = isTrue(core.getInput("fail_ci_if_error"));
const verbose = isTrue(core.getInput("verbose"));
request({
json: false,
@@ -2651,6 +2653,22 @@ try {
);
}
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)
.catch(err => {
if (fail_ci) {

6
hooks/pre-commit Executable file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
npm i --package-lock-only
npm run build
git add package-lock.json
git add dist/index.js

View File

@@ -3,8 +3,19 @@ const exec = require("@actions/exec");
const fs = require("fs");
const request = require('requestretry');
let fail_ci;
try {
const isTrue = arg => {
const lowerVar = arg.toLowerCase();
return (
arg === "yes" ||
arg === "y" ||
arg === "true" ||
arg === "t" ||
arg === "1"
) ? true : false;
}
const name = core.getInput("name");
const token = core.getInput("token");
const flags = core.getInput("flags");
@@ -13,24 +24,12 @@ try {
const env_vars = core.getInput("env_vars");
const dir = core.getInput("directory");
const write_path = core.getInput("path_to_write_report");
const verbose = core.getInput("verbose");
const working_dir = core.getInput("working-directory");
const xcode_derived_data = core.getInput("xcode_derived_data");
const xcode_package = core.getInput("xcode_package");
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;
}
const fail_ci = isTrue(core.getInput("fail_ci_if_error"));
const verbose = isTrue(core.getInput("verbose"));
request({
json: false,

12
install.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
if ! [ -e .git ]; then
echo "Please run this from repo root directory"
exit 1
fi
cd .git/hooks
for i in pre-commit; do
rm -fv $i
ln -sv ../../hooks/$i
done

56
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "codecov-action",
"version": "1.0.15",
"version": "1.1.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -2119,8 +2119,7 @@
"growly": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=",
"optional": true
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE="
},
"har-schema": {
"version": "2.0.0",
@@ -2352,8 +2351,7 @@
"is-docker": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==",
"optional": true
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw=="
},
"is-extendable": {
"version": "0.1.1",
@@ -2407,7 +2405,6 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
"optional": true,
"requires": {
"is-docker": "^2.0.0"
}
@@ -4060,6 +4057,14 @@
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
"integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg="
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
@@ -4214,10 +4219,9 @@
"integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA="
},
"node-notifier": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.0.tgz",
"integrity": "sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA==",
"optional": true,
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz",
"integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==",
"requires": {
"growly": "^1.3.0",
"is-wsl": "^2.2.0",
@@ -4228,22 +4232,22 @@
},
"dependencies": {
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
"optional": true
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"uuid": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz",
"integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==",
"optional": true
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"optional": true,
"requires": {
"isexe": "^2.0.0"
}
@@ -4901,8 +4905,7 @@
"shellwords": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
"optional": true
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww=="
},
"signal-exit": {
"version": "3.0.3",
@@ -5384,9 +5387,9 @@
}
},
"typescript": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz",
"integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ=="
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz",
"integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg=="
},
"union-value": {
"version": "1.0.1",
@@ -5620,6 +5623,11 @@
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",

View File

@@ -1,6 +1,6 @@
{
"name": "codecov-action",
"version": "1.0.16",
"version": "1.1.1",
"description": "Upload coverage reports to Codecov from GitHub Actions",
"main": "index.js",
"scripts": {
@@ -32,7 +32,7 @@
"request": "^2.88.2",
"requestretry": "^4.1.2",
"ts-jest": "^26.4.4",
"typescript": "^4.1.2",
"typescript": "^4.1.3",
"yarn": "^1.22.10"
},
"devDependencies": {}