mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fc7722ded | ||
|
|
08574d831c | ||
|
|
0c1af46295 | ||
|
|
f8c87eb84e | ||
|
|
8b988c28b0 | ||
|
|
4686d7034c | ||
|
|
4ef30f27a0 | ||
|
|
58cd650984 | ||
|
|
efb844969e | ||
|
|
c6de3f8548 | ||
|
|
7de43a7373 | ||
|
|
d3e4a774c5 | ||
|
|
09facdbe25 | ||
|
|
c770ad46b3 | ||
|
|
55dde41e2b | ||
|
|
beb5a9626e | ||
|
|
a869df4496 | ||
|
|
a116b3286f | ||
|
|
a6c42c7a01 | ||
|
|
3c9462a34c | ||
|
|
5155bd4dd2 | ||
|
|
c047d5942e | ||
|
|
d9b5cc1d8b | ||
|
|
0d4ed40235 | ||
|
|
3db8e6c626 |
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
|
||||
@@ -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:
|
||||
|
||||
>**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* |
|
||||
@@ -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
|
||||
| `path_to_write_report` | Write upload file to path before uploading | 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
|
||||
|
||||
@@ -84,7 +85,7 @@ jobs:
|
||||
env_vars: OS,PYTHON
|
||||
name: codecov-umbrella
|
||||
fail_ci_if_error: true
|
||||
path_to_write_report: ./coverage/codecov_report.gz
|
||||
path_to_write_report: ./coverage/codecov_report.txt
|
||||
verbose: true
|
||||
```
|
||||
## Contributing
|
||||
|
||||
@@ -32,6 +32,9 @@ inputs:
|
||||
verbose:
|
||||
description: 'Specify whether the Codecov output should be verbose'
|
||||
required: false
|
||||
working-directory:
|
||||
description: 'Directory in which to execute codecov.sh'
|
||||
required: false
|
||||
branding:
|
||||
color: 'red'
|
||||
icon: 'umbrella'
|
||||
|
||||
34
dist/index.js
vendored
34
dist/index.js
vendored
@@ -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");
|
||||
@@ -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" ||
|
||||
@@ -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,
|
||||
@@ -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) {
|
||||
|
||||
5
hooks/pre-commit
Executable file
5
hooks/pre-commit
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
npm i --package-lock-only
|
||||
npm run build
|
||||
git add dist/index.js
|
||||
34
index.js
34
index.js
@@ -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");
|
||||
@@ -13,9 +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" ||
|
||||
@@ -29,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,
|
||||
@@ -135,6 +151,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) {
|
||||
|
||||
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
|
||||
20
package-lock.json
generated
20
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codecov-action",
|
||||
"version": "1.0.14",
|
||||
"version": "1.1.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -988,9 +988,9 @@
|
||||
}
|
||||
},
|
||||
"@types/jest": {
|
||||
"version": "26.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.15.tgz",
|
||||
"integrity": "sha512-s2VMReFXRg9XXxV+CW9e5Nz8fH2K1aEhwgjUqPPbQd7g95T0laAcvLv032EhFHIa5GHsZ8W7iJEQVaJq6k3Gog==",
|
||||
"version": "26.0.19",
|
||||
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.19.tgz",
|
||||
"integrity": "sha512-jqHoirTG61fee6v6rwbnEuKhpSKih0tuhqeFbCmMmErhtu3BYlOZaXWjffgOstMM4S/3iQD31lI5bGLTrs97yQ==",
|
||||
"requires": {
|
||||
"jest-diff": "^26.0.0",
|
||||
"pretty-format": "^26.0.0"
|
||||
@@ -4634,9 +4634,9 @@
|
||||
}
|
||||
},
|
||||
"requestretry": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/requestretry/-/requestretry-4.1.1.tgz",
|
||||
"integrity": "sha512-sV2lkWitASDXpIK+m0scC7dHBkW42EKj5iao6Cp8GCXsXY7qS4Q/min6PP5YBuqgV9W38lsA7LUhEkOezl1/Og==",
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/requestretry/-/requestretry-4.1.2.tgz",
|
||||
"integrity": "sha512-N1WAp+8eOy8NfsVBChcSxNCKvPY1azOpliQ4Sby4WDe0HFEhdKywlNZeROMBQ+BI3Jpc0eNOT1KVFGREawtahA==",
|
||||
"requires": {
|
||||
"extend": "^3.0.2",
|
||||
"lodash": "^4.17.15",
|
||||
@@ -5384,9 +5384,9 @@
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
|
||||
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ=="
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz",
|
||||
"integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ=="
|
||||
},
|
||||
"union-value": {
|
||||
"version": "1.0.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codecov-action",
|
||||
"version": "1.0.15",
|
||||
"version": "1.1.1",
|
||||
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -24,15 +24,15 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@types/jest": "^26.0.15",
|
||||
"@types/jest": "^26.0.19",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"fs": "0.0.1-security",
|
||||
"jest": "^26.6.3",
|
||||
"jest-junit": "^12.0.0",
|
||||
"request": "^2.88.2",
|
||||
"requestretry": "^4.1.1",
|
||||
"requestretry": "^4.1.2",
|
||||
"ts-jest": "^26.4.4",
|
||||
"typescript": "^4.0.5",
|
||||
"typescript": "^4.1.2",
|
||||
"yarn": "^1.22.10"
|
||||
},
|
||||
"devDependencies": {}
|
||||
|
||||
Reference in New Issue
Block a user