Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automations ensure proper builds and deployments | Fix verbose flag #184

Merged
merged 9 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 1.1.1

#### Fixes
- #184 Add automations ensure proper builds and deployments
- #184 Fixes verbose flag

### 1.1.0

#### Features
Expand Down
Empty file added Makefile
Empty file.
34 changes: 33 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,7 @@ const fs = __webpack_require__(747);
const request = __webpack_require__(335);

let fail_ci;
let verbose;
try {
const name = core.getInput("name");
const token = core.getInput("token");
Expand All @@ -2529,9 +2530,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();
verbose = core.getInput("verbose").toLowerCase();

if (
fail_ci === "yes" ||
Expand All @@ -2545,6 +2549,18 @@ try {
fail_ci = false;
}

if (
verbose === "yes" ||
verbose === "y" ||
verbose === "true" ||
verbose === "t" ||
verbose === "1"
) {
verbose = true;
} else {
verbose = false;
}

request({
json: false,
maxAttempts: 10,
Expand Down Expand Up @@ -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)
.catch(err => {
if (fail_ci) {
Expand Down
5 changes: 5 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

npm i --package-lock-only
npm run build
git add dist/index.js
15 changes: 14 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const fs = require("fs");
const request = require('requestretry');

let fail_ci;
let verbose;
try {
const name = core.getInput("name");
const token = core.getInput("token");
Expand All @@ -13,12 +14,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();
verbose = core.getInput("verbose").toLowerCase();

if (
fail_ci === "yes" ||
Expand All @@ -32,6 +33,18 @@ try {
fail_ci = false;
}

if (
verbose === "yes" ||
verbose === "y" ||
verbose === "true" ||
verbose === "t" ||
verbose === "1"
) {
verbose = true;
} else {
verbose = false;
}

request({
json: false,
maxAttempts: 10,
Expand Down
12 changes: 12 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down