Merge pull request #184 from codecov/makefile

Add automations ensure proper builds and deployments | Fix verbose flag
This commit is contained in:
Tom Hu 2020-12-21 08:57:25 -05:00 committed by GitHub
commit 1fc7722ded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 72 additions and 4 deletions

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 ### 1.1.0
#### Features #### Features

0
Makefile Normal file
View file

34
dist/index.js vendored
View file

@ -2520,6 +2520,7 @@ const fs = __webpack_require__(747);
const request = __webpack_require__(335); const request = __webpack_require__(335);
let fail_ci; let fail_ci;
let verbose;
try { try {
const name = core.getInput("name"); const name = core.getInput("name");
const token = core.getInput("token"); const token = core.getInput("token");
@ -2529,9 +2530,12 @@ try {
const env_vars = core.getInput("env_vars"); const env_vars = core.getInput("env_vars");
const dir = core.getInput("directory"); const dir = core.getInput("directory");
const write_path = core.getInput("path_to_write_report"); 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(); fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
verbose = core.getInput("verbose").toLowerCase();
if ( if (
fail_ci === "yes" || fail_ci === "yes" ||
@ -2545,6 +2549,18 @@ try {
fail_ci = false; fail_ci = false;
} }
if (
verbose === "yes" ||
verbose === "y" ||
verbose === "true" ||
verbose === "t" ||
verbose === "1"
) {
verbose = true;
} else {
verbose = false;
}
request({ request({
json: false, json: false,
maxAttempts: 10, maxAttempts: 10,
@ -2651,6 +2667,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) exec.exec("bash", execArgs, options)
.catch(err => { .catch(err => {
if (fail_ci) { if (fail_ci) {

5
hooks/pre-commit Executable file
View file

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

View file

@ -4,6 +4,7 @@ const fs = require("fs");
const request = require('requestretry'); const request = require('requestretry');
let fail_ci; let fail_ci;
let verbose;
try { try {
const name = core.getInput("name"); const name = core.getInput("name");
const token = core.getInput("token"); const token = core.getInput("token");
@ -13,12 +14,12 @@ try {
const env_vars = core.getInput("env_vars"); const env_vars = core.getInput("env_vars");
const dir = core.getInput("directory"); const dir = core.getInput("directory");
const write_path = core.getInput("path_to_write_report"); const write_path = core.getInput("path_to_write_report");
const verbose = core.getInput("verbose");
const working_dir = core.getInput("working-directory"); const working_dir = core.getInput("working-directory");
const xcode_derived_data = core.getInput("xcode_derived_data"); const xcode_derived_data = core.getInput("xcode_derived_data");
const xcode_package = core.getInput("xcode_package"); const xcode_package = core.getInput("xcode_package");
fail_ci = core.getInput("fail_ci_if_error").toLowerCase(); fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
verbose = core.getInput("verbose").toLowerCase();
if ( if (
fail_ci === "yes" || fail_ci === "yes" ||
@ -32,6 +33,18 @@ try {
fail_ci = false; fail_ci = false;
} }
if (
verbose === "yes" ||
verbose === "y" ||
verbose === "true" ||
verbose === "t" ||
verbose === "1"
) {
verbose = true;
} else {
verbose = false;
}
request({ request({
json: false, json: false,
maxAttempts: 10, maxAttempts: 10,

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

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "codecov-action", "name": "codecov-action",
"version": "1.0.15", "version": "1.1.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "codecov-action", "name": "codecov-action",
"version": "1.0.16", "version": "1.1.1",
"description": "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": {