mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
50 Commits
v1.0.14
...
working-di
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7648985a72 | ||
|
|
ec4c4ecb5a | ||
|
|
ffd79df3ec | ||
|
|
a5c8752567 | ||
|
|
428cd7ca3d | ||
|
|
035df630e7 | ||
|
|
33f1d301f6 | ||
|
|
5b42a305f9 | ||
|
|
29c457e537 | ||
|
|
b3ee0b08ef | ||
|
|
133f89a6b7 | ||
|
|
a03d57cdbd | ||
|
|
1fc7722ded | ||
|
|
08574d831c | ||
|
|
0c1af46295 | ||
|
|
f8c87eb84e | ||
|
|
8b988c28b0 | ||
|
|
4686d7034c | ||
|
|
4ef30f27a0 | ||
|
|
58cd650984 | ||
|
|
efb844969e | ||
|
|
c6de3f8548 | ||
|
|
7de43a7373 | ||
|
|
d3e4a774c5 | ||
|
|
09facdbe25 | ||
|
|
c770ad46b3 | ||
|
|
55dde41e2b | ||
|
|
11de6e2a71 | ||
|
|
beb5a9626e | ||
|
|
a869df4496 | ||
|
|
a116b3286f | ||
|
|
a6c42c7a01 | ||
|
|
3c9462a34c | ||
|
|
5155bd4dd2 | ||
|
|
c047d5942e | ||
|
|
d9b5cc1d8b | ||
|
|
0d4ed40235 | ||
|
|
239febf655 | ||
|
|
089f66bf94 | ||
|
|
3db8e6c626 | ||
|
|
97477378d5 | ||
|
|
5aab34a5de | ||
|
|
7bd0b70f4c | ||
|
|
e1530fdc6a | ||
|
|
4093ac2f32 | ||
|
|
f1824ac807 | ||
|
|
3fbed96f43 | ||
|
|
54f44cc9f4 | ||
|
|
a74dfd1451 | ||
|
|
5bdef2c17a |
15
.github/workflows/main.yml
vendored
15
.github/workflows/main.yml
vendored
@@ -13,15 +13,26 @@ jobs:
|
|||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
|
fail_ci_if_error: true
|
||||||
file: ./coverage/coverage-final.json
|
file: ./coverage/coverage-final.json
|
||||||
|
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
|
||||||
flags: unittest
|
flags: unittest
|
||||||
name: codecov-1
|
name: codecov-1
|
||||||
- name: Upload coverage to Codecov (verbose)
|
- name: Upload coverage to Codecov (verbose)
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
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
|
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
|
||||||
file: ./coverage/coverage-final.json
|
file: ./coverage/coverage-final.json
|
||||||
flags: unittest
|
flags: unittest
|
||||||
name: codecov-1
|
name: codecov-1
|
||||||
verbose: true
|
working-directory: src/
|
||||||
|
|||||||
19
CHANGELOG.md
Normal file
19
CHANGELOG.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
### 1.1.1
|
||||||
|
|
||||||
|
#### Fixes
|
||||||
|
- #184 Add automations ensure proper builds and deployments
|
||||||
|
- #184 Fixes verbose flag
|
||||||
|
|
||||||
|
### 1.1.0
|
||||||
|
|
||||||
|
#### Features
|
||||||
|
- #110 Add "working-directory:" input
|
||||||
|
- #174 Support Xcode specificed parameters
|
||||||
|
|
||||||
|
#### Fixes
|
||||||
|
- #172 File is saved as text
|
||||||
|
|
||||||
|
#### Dependencies and Misc
|
||||||
|
- #166 Bump requestretry from 4.1.1 to 4.1.2
|
||||||
|
- #169 Bump typescript from 4.0.5 to 4.1.2
|
||||||
|
- #178 Bump @types/jest from 26.0.15 to 26.0.19
|
||||||
7
Makefile
Normal file
7
Makefile
Normal 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
|
||||||
@@ -33,8 +33,6 @@ steps:
|
|||||||
|
|
||||||
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:
|
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 |
|
| Input | Description | Usage |
|
||||||
| :---: | :---: | :---: |
|
| :---: | :---: | :---: |
|
||||||
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
|
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
|
||||||
@@ -47,6 +45,9 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
|
|||||||
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | 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
|
| `path_to_write_report` | Write upload file to path before uploading | Optional
|
||||||
| `verbose` | Specify whether the Codecov output should be verbose | Optional
|
| `verbose` | Specify whether the Codecov output should be verbose | Optional
|
||||||
|
| `working-directory` | Directory in which to execute `codecov.sh` | Optional
|
||||||
|
| `xcode_derived_data` | Custom Derived Data Path for Coverage.profdata and gcov processing | Optional
|
||||||
|
| `xcode_package` | Specify packages to build coverage. Uploader will only build these packages. This can significantly reduces time to build coverage reports. -J 'MyAppName' Will match "MyAppName" and "MyAppNameTests" -J '^ExampleApp$' Will match only "ExampleApp" not "ExampleAppTests" | Optional
|
||||||
|
|
||||||
### Example `workflow.yml` with Codecov Action
|
### Example `workflow.yml` with Codecov Action
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ jobs:
|
|||||||
env_vars: OS,PYTHON
|
env_vars: OS,PYTHON
|
||||||
name: codecov-umbrella
|
name: codecov-umbrella
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
path_to_write_report: ./coverage/codecov_report.gz
|
path_to_write_report: ./coverage/codecov_report.txt
|
||||||
verbose: true
|
verbose: true
|
||||||
```
|
```
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ inputs:
|
|||||||
verbose:
|
verbose:
|
||||||
description: 'Specify whether the Codecov output should be verbose'
|
description: 'Specify whether the Codecov output should be verbose'
|
||||||
required: false
|
required: false
|
||||||
|
working-directory:
|
||||||
|
description: 'Directory in which to execute codecov.sh'
|
||||||
|
required: false
|
||||||
branding:
|
branding:
|
||||||
color: 'red'
|
color: 'red'
|
||||||
icon: 'umbrella'
|
icon: 'umbrella'
|
||||||
|
|||||||
50
dist/index.js
vendored
50
dist/index.js
vendored
@@ -2519,8 +2519,19 @@ const exec = __webpack_require__(986);
|
|||||||
const fs = __webpack_require__(747);
|
const fs = __webpack_require__(747);
|
||||||
const request = __webpack_require__(335);
|
const request = __webpack_require__(335);
|
||||||
|
|
||||||
let fail_ci;
|
|
||||||
try {
|
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 name = core.getInput("name");
|
||||||
const token = core.getInput("token");
|
const token = core.getInput("token");
|
||||||
const flags = core.getInput("flags");
|
const flags = core.getInput("flags");
|
||||||
@@ -2529,21 +2540,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();
|
const fail_ci = isTrue(core.getInput("fail_ci_if_error"));
|
||||||
|
const verbose = isTrue(core.getInput("verbose"));
|
||||||
if (
|
|
||||||
fail_ci === "yes" ||
|
|
||||||
fail_ci === "y" ||
|
|
||||||
fail_ci === "true" ||
|
|
||||||
fail_ci === "t" ||
|
|
||||||
fail_ci === "1"
|
|
||||||
) {
|
|
||||||
fail_ci = true;
|
|
||||||
} else {
|
|
||||||
fail_ci = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
request({
|
request({
|
||||||
json: false,
|
json: false,
|
||||||
@@ -2600,6 +2602,8 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const execArgs = ["codecov.sh"];
|
const execArgs = ["codecov.sh"];
|
||||||
|
execArgs.push("-Q", "github-action");
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
execArgs.push(
|
execArgs.push(
|
||||||
"-f", `${file}`
|
"-f", `${file}`
|
||||||
@@ -2649,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)
|
exec.exec("bash", execArgs, options)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (fail_ci) {
|
if (fail_ci) {
|
||||||
|
|||||||
6
hooks/pre-commit
Executable file
6
hooks/pre-commit
Executable 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
|
||||||
50
index.js
50
index.js
@@ -3,8 +3,19 @@ const exec = require("@actions/exec");
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const request = require('requestretry');
|
const request = require('requestretry');
|
||||||
|
|
||||||
let fail_ci;
|
|
||||||
try {
|
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 name = core.getInput("name");
|
||||||
const token = core.getInput("token");
|
const token = core.getInput("token");
|
||||||
const flags = core.getInput("flags");
|
const flags = core.getInput("flags");
|
||||||
@@ -13,21 +24,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();
|
const fail_ci = isTrue(core.getInput("fail_ci_if_error"));
|
||||||
|
const verbose = isTrue(core.getInput("verbose"));
|
||||||
if (
|
|
||||||
fail_ci === "yes" ||
|
|
||||||
fail_ci === "y" ||
|
|
||||||
fail_ci === "true" ||
|
|
||||||
fail_ci === "t" ||
|
|
||||||
fail_ci === "1"
|
|
||||||
) {
|
|
||||||
fail_ci = true;
|
|
||||||
} else {
|
|
||||||
fail_ci = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
request({
|
request({
|
||||||
json: false,
|
json: false,
|
||||||
@@ -84,6 +86,8 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const execArgs = ["codecov.sh"];
|
const execArgs = ["codecov.sh"];
|
||||||
|
execArgs.push("-Q", "github-action");
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
execArgs.push(
|
execArgs.push(
|
||||||
"-f", `${file}`
|
"-f", `${file}`
|
||||||
@@ -133,6 +137,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) {
|
||||||
|
|||||||
12
install.sh
Executable file
12
install.sh
Executable 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
|
||||||
1403
package-lock.json
generated
1403
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codecov-action",
|
"name": "codecov-action",
|
||||||
"version": "1.0.14",
|
"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": {
|
||||||
@@ -24,15 +24,15 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.6",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@types/jest": "^26.0.14",
|
"@types/jest": "^26.0.19",
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@zeit/ncc": "^0.22.3",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"jest": "^26.5.3",
|
"jest": "^26.6.3",
|
||||||
"jest-junit": "^12.0.0",
|
"jest-junit": "^12.0.0",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"requestretry": "^4.1.1",
|
"requestretry": "^4.1.2",
|
||||||
"ts-jest": "^26.4.1",
|
"ts-jest": "^26.4.4",
|
||||||
"typescript": "^4.0.3",
|
"typescript": "^4.1.3",
|
||||||
"yarn": "^1.22.10"
|
"yarn": "^1.22.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {}
|
"devDependencies": {}
|
||||||
|
|||||||
Reference in New Issue
Block a user