mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
109 Commits
v1.2.2
...
fail-ci-te
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2bc7b3d58 | ||
|
|
a48be3a378 | ||
|
|
d404e59e88 | ||
|
|
2d78cca173 | ||
|
|
ae8835afc4 | ||
|
|
6c61a504e3 | ||
|
|
28b82119da | ||
|
|
ccdd5a11a4 | ||
|
|
a9bf7a39e6 | ||
|
|
98a1251dbc | ||
|
|
265c6565d0 | ||
|
|
6c58d35c22 | ||
|
|
29386c70ef | ||
|
|
52497068bd | ||
|
|
fbeda37de9 | ||
|
|
ebcf63d8f0 | ||
|
|
a3e633d744 | ||
|
|
b8f68524af | ||
|
|
c9d0b8155c | ||
|
|
8f0855a85c | ||
|
|
c53d6ba320 | ||
|
|
67f597a1c4 | ||
|
|
23d300342d | ||
|
|
328e5ac01f | ||
|
|
9048ba87af | ||
|
|
004e333947 | ||
|
|
840a99b437 | ||
|
|
3cae11df75 | ||
|
|
fb7c8dcad3 | ||
|
|
8790aaf6ce | ||
|
|
e04986db44 | ||
|
|
92cbe0669f | ||
|
|
7ed20fef2d | ||
|
|
95c9f38035 | ||
|
|
5dab066a61 | ||
|
|
ff5bbb3aa8 | ||
|
|
6dfc35f92d | ||
|
|
069f3918b5 | ||
|
|
3ee49263a4 | ||
|
|
da4a4a1c99 | ||
|
|
5eebf0436a | ||
|
|
9feddcab70 | ||
|
|
a18b323e89 | ||
|
|
f8e6b45999 | ||
|
|
a737162646 | ||
|
|
18b0d954de | ||
|
|
bad627d1b6 | ||
|
|
ab8eb9dc66 | ||
|
|
407299cffc | ||
|
|
b072ed5085 | ||
|
|
1f38181652 | ||
|
|
39ec4545ca | ||
|
|
d5985f56ba | ||
|
|
4ce3eb846f | ||
|
|
b6708446cb | ||
|
|
16a94c297b | ||
|
|
c6981a3267 | ||
|
|
2494ac533b | ||
|
|
4c6214fb7a | ||
|
|
7402d15ad2 | ||
|
|
b80bc84850 | ||
|
|
a1ed4b322b | ||
|
|
2332a737fb | ||
|
|
dc56cf479e | ||
|
|
a5399823bb | ||
|
|
9f471fc6f8 | ||
|
|
062fb177ae | ||
|
|
31d2c8f775 | ||
|
|
47ed2776b9 | ||
|
|
b37e21182f | ||
|
|
fd42ae77ab | ||
|
|
998cb33cad | ||
|
|
052dc5d29d | ||
|
|
3e2901753e | ||
|
|
6b52f2a1d9 | ||
|
|
4789835c72 | ||
|
|
47b1f9735f | ||
|
|
298ba60aef | ||
|
|
abf28f2040 | ||
|
|
cdc2a0ed57 | ||
|
|
967e2b38a8 | ||
|
|
77a7b61cd5 | ||
|
|
50895b2a6f | ||
|
|
95e6f30a60 | ||
|
|
0e28ff86a5 | ||
|
|
72182f9425 | ||
|
|
ce1ffb8db7 | ||
|
|
864620acb9 | ||
|
|
6ac8172373 | ||
|
|
5ab0dbc584 | ||
|
|
5e8c27dd4d | ||
|
|
444b352d52 | ||
|
|
83cbbf806b | ||
|
|
040839f579 | ||
|
|
6e56f7a5a6 | ||
|
|
ae04cc96c3 | ||
|
|
d2569b4d35 | ||
|
|
216c5372a9 | ||
|
|
9b0b9bbe2c | ||
|
|
1ee0196081 | ||
|
|
c6a36d2dbb | ||
|
|
aaf0ccb935 | ||
|
|
d9a1bbc2da | ||
|
|
18017b2a95 | ||
|
|
fcebab03f2 | ||
|
|
7ea3ba9ac0 | ||
|
|
6ed0d16b40 | ||
|
|
79a0ba12c8 | ||
|
|
b349bb9c57 |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
- name: Upload coverage to Codecov (demo)
|
||||
uses: ./
|
||||
with:
|
||||
fail_ci_if_error: false
|
||||
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
|
||||
file: ./coverage/coverage-final.json
|
||||
flags: demo
|
||||
@@ -22,6 +23,7 @@ jobs:
|
||||
- name: Upload coverage to Codecov (script)
|
||||
uses: ./
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
files: ./coverage/script/coverage-final.json
|
||||
flags: script
|
||||
name: codecov-script
|
||||
|
||||
94
CHANGELOG.md
94
CHANGELOG.md
@@ -1,38 +1,98 @@
|
||||
### 1.2.2
|
||||
## 1.5.2
|
||||
### Fixes
|
||||
- # fix: Import version properly as string not object
|
||||
|
||||
#### Fixes
|
||||
## 1.5.1
|
||||
### Fixes
|
||||
- #320 doc: add github actions badge
|
||||
- #336 Update bash uploader to 1.0.3
|
||||
- #339 fix: Add action version
|
||||
|
||||
### Dependencies
|
||||
- #302 Bump @typescript-eslint/eslint-plugin from 4.22.0 to 4.22.1
|
||||
- #303 Bump @typescript-eslint/parser from 4.22.0 to 4.22.1
|
||||
- #304 Bump ts-jest from 26.5.5 to 26.5.6
|
||||
- #309 Bump lodash from 4.17.19 to 4.17.21
|
||||
- #310 Bump hosted-git-info from 2.8.8 to 2.8.9
|
||||
- #311 Bump @actions/github from 4.0.0 to 5.0.0
|
||||
- #314 Bump eslint from 7.25.0 to 7.27.0
|
||||
- #315 Bump @actions/core from 1.2.7 to 1.3.0
|
||||
- #316 Bump @typescript-eslint/parser from 4.22.1 to 4.25.0
|
||||
- #317 Bump @typescript-eslint/eslint-plugin from 4.22.1 to 4.25.0
|
||||
- #319 Bump jest-junit from 12.0.0 to 12.1.0
|
||||
- #321 Bump typescript from 4.2.4 to 4.3.2
|
||||
- #323 Bump ws from 7.3.1 to 7.4.6
|
||||
- #331 Bump eslint from 7.27.0 to 7.28.0
|
||||
- #332 Bump @actions/exec from 1.0.4 to 1.1.0
|
||||
- #333 Bump @typescript-eslint/parser from 4.25.0 to 4.26.1
|
||||
- #334 Bump @typescript-eslint/eslint-plugin from 4.25.0 to 4.26.1
|
||||
- #335 Bump @actions/core from 1.3.0 to 1.4.0
|
||||
- #337 Bump glob-parent from 5.1.1 to 5.1.2
|
||||
|
||||
## 1.5.0
|
||||
### Features
|
||||
- #299 Pull Codecov bash script into the action
|
||||
|
||||
### Dependencies
|
||||
- #271 Bump typescript from 4.2.3 to 4.2.4
|
||||
- #277 Bump @typescript-eslint/eslint-plugin from 4.16.1 to 4.22.0
|
||||
- #278 Bump @typescript-eslint/parser from 4.20.0 to 4.22.0
|
||||
- #279 Bump @actions/core from 1.2.6 to 1.2.7
|
||||
- #292 Bump ts-jest from 26.5.3 to 26.5.5
|
||||
- #293 Bump eslint from 7.21.0 to 7.25.0
|
||||
- #297 Bump @types/jest from 26.0.20 to 26.0.23
|
||||
- #298 Upgrade to GitHub-native Dependabot
|
||||
|
||||
## 1.4.1
|
||||
### Fixes
|
||||
- #287 Update VERSION regex to restrict on digits and dot and move checksums into script
|
||||
|
||||
## 1.4.0
|
||||
### Features
|
||||
- #282 Add checksum verification of bash script
|
||||
|
||||
## 1.3.2
|
||||
### Fixes
|
||||
- #264 Overwrites pr number for pull_request_target events
|
||||
|
||||
## 1.3.1
|
||||
### Fixes
|
||||
- #253 Add `network_filter` to action manifest
|
||||
|
||||
## 1.3.0
|
||||
### Features
|
||||
- #252 Add "network_filter" input
|
||||
|
||||
## 1.2.2
|
||||
### Fixes
|
||||
- #241 pass root_dir using proper bash arg
|
||||
- #244 Overwrite the commit on pull_request* events
|
||||
|
||||
### 1.2.1
|
||||
|
||||
#### Fixes
|
||||
## 1.2.1
|
||||
### Fixes
|
||||
- #196 Add parameters to the action.yml
|
||||
|
||||
### 1.2.0
|
||||
|
||||
#### Features
|
||||
## 1.2.0
|
||||
### Features
|
||||
- #193 Add all the bash params
|
||||
|
||||
#### Fixes
|
||||
### Fixes
|
||||
- #193 Fixes issue with working-directory
|
||||
|
||||
### 1.1.1
|
||||
|
||||
#### Fixes
|
||||
## 1.1.1
|
||||
### Fixes
|
||||
- #184 Add automations ensure proper builds and deployments
|
||||
- #184 Fixes verbose flag
|
||||
|
||||
### 1.1.0
|
||||
|
||||
#### Features
|
||||
## 1.1.0
|
||||
### Features
|
||||
- #110 Add "working-directory:" input
|
||||
- #174 Support Xcode specificed parameters
|
||||
|
||||
#### Fixes
|
||||
### Fixes
|
||||
- #172 File is saved as text
|
||||
|
||||
#### Dependencies and Misc
|
||||
### 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
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
[](https://github.com/marketplace/actions/codecov)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield)
|
||||
[](https://github.com/codecov/codecov-action/actions/workflows/main.yml)
|
||||
### Easily upload coverage reports to Codecov from GitHub Actions
|
||||
|
||||
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
|
||||
|
||||
@@ -59,6 +59,9 @@ inputs:
|
||||
name:
|
||||
description: 'User defined upload name. Visible in Codecov UI'
|
||||
required: false
|
||||
network_filter:
|
||||
description: 'Used to restrict the set of git/hg files that can be matched with filenames in the coverage report. This is useful for monorepos or other setups where a full filepath may not be specified in the coverage report, and that shortened filepath may appear multiple times in a directory structure (e.g. __init__.py)'
|
||||
required: false
|
||||
override_branch:
|
||||
description: 'Specify the branch name'
|
||||
required: false
|
||||
|
||||
1884
dist/codecov
vendored
Normal file
1884
dist/codecov
vendored
Normal file
File diff suppressed because it is too large
Load Diff
54365
dist/index.js
vendored
54365
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
npm i --package-lock-only
|
||||
set -e
|
||||
|
||||
npm install
|
||||
npm run lint --fix
|
||||
npm run build
|
||||
git add src/
|
||||
git add dist/index.js
|
||||
git add dist/
|
||||
git add package-lock.json
|
||||
|
||||
1625
package-lock.json
generated
1625
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codecov-action",
|
||||
"version": "1.2.2",
|
||||
"version": "1.5.2",
|
||||
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -23,24 +23,24 @@
|
||||
},
|
||||
"homepage": "https://github.com/codecov/codecov-action#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/github": "^4.0.0",
|
||||
"@types/jest": "^26.0.20",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"@actions/core": "^1.4.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"fs": "0.0.1-security",
|
||||
"jest": "^26.6.3",
|
||||
"jest-junit": "^12.0.0",
|
||||
"request": "^2.88.2",
|
||||
"requestretry": "^5.0.0",
|
||||
"ts-jest": "^26.5.3",
|
||||
"typescript": "^4.2.3",
|
||||
"yarn": "^1.22.10"
|
||||
"request": "^2.88.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
||||
"@typescript-eslint/parser": "^4.16.1",
|
||||
"eslint": "^7.21.0",
|
||||
"eslint-config-google": "^0.14.0"
|
||||
"@types/jest": "^26.0.23",
|
||||
"@types/node": "^14.17.3",
|
||||
"@typescript-eslint/eslint-plugin": "^4.26.1",
|
||||
"@typescript-eslint/parser": "^4.26.1",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"eslint": "^7.28.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"jest": "^26.6.3",
|
||||
"jest-junit": "^12.2.0",
|
||||
"ts-jest": "^26.5.6",
|
||||
"typescript": "^4.3.2",
|
||||
"yarn": "^1.22.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import buildExec from './buildExec';
|
||||
const github = require('@actions/github');
|
||||
|
||||
import VERSION from './version';
|
||||
|
||||
const context = github.context;
|
||||
|
||||
test('no arguments', () => {
|
||||
@@ -12,7 +15,7 @@ test('no arguments', () => {
|
||||
'-F',
|
||||
'',
|
||||
'-Q',
|
||||
'github-action',
|
||||
`github-action-${VERSION}`,
|
||||
];
|
||||
if (context.eventName == 'pull_request') {
|
||||
args.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||
@@ -42,6 +45,7 @@ test('all arguments', () => {
|
||||
'gcov_path_include': '**/include-dir/*.*',
|
||||
'gcov_prefix': 'demo',
|
||||
'name': 'codecov',
|
||||
'network_filter': 'dir1',
|
||||
'override_branch': 'thomasrockhu/test',
|
||||
'override_build': '1',
|
||||
'override_commit': '9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||
@@ -69,7 +73,7 @@ test('all arguments', () => {
|
||||
'-F',
|
||||
'test',
|
||||
'-Q',
|
||||
'github-action',
|
||||
`github-action-${VERSION}`,
|
||||
'-c',
|
||||
'-N',
|
||||
'83231650328f11695dfb754ca0f540516f188d27',
|
||||
@@ -114,6 +118,8 @@ test('all arguments', () => {
|
||||
'**/include-dir/*.*',
|
||||
'-k',
|
||||
'demo',
|
||||
'-i',
|
||||
'dir1',
|
||||
'-B',
|
||||
'thomasrockhu/test',
|
||||
'-b',
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
const core = require('@actions/core');
|
||||
const github = require('@actions/github');
|
||||
|
||||
import VERSION from './version';
|
||||
|
||||
const context = github.context;
|
||||
|
||||
const isTrue = (variable) => {
|
||||
@@ -32,6 +34,7 @@ const buildExec = () => {
|
||||
const gcovInclude = core.getInput('gcov_path_include');
|
||||
const gcovPrefix = core.getInput('gcov_prefix');
|
||||
const name = core.getInput('name');
|
||||
const networkFilter = core.getInput('network_filter');
|
||||
const overrideBranch = core.getInput('override_branch');
|
||||
const overrideBuild = core.getInput('override_build');
|
||||
const overrideCommit = core.getInput('override_commit');
|
||||
@@ -50,7 +53,14 @@ const buildExec = () => {
|
||||
workingDir + '/codecov.sh' : 'codecov.sh';
|
||||
|
||||
const execArgs = [filepath];
|
||||
execArgs.push( '-n', `${name}`, '-F', `${flags}`, '-Q', 'github-action' );
|
||||
execArgs.push(
|
||||
'-n',
|
||||
`${name}`,
|
||||
'-F',
|
||||
`${flags}`,
|
||||
'-Q',
|
||||
`github-action-${VERSION}`,
|
||||
);
|
||||
|
||||
const options:any = {};
|
||||
options.env = Object.assign(process.env, {
|
||||
@@ -123,6 +133,9 @@ const buildExec = () => {
|
||||
if (gcovPrefix) {
|
||||
execArgs.push('-k', `${gcovPrefix}`);
|
||||
}
|
||||
if (networkFilter) {
|
||||
execArgs.push('-i', `${networkFilter}`);
|
||||
}
|
||||
if (overrideBranch) {
|
||||
execArgs.push('-B', `${overrideBranch}`);
|
||||
}
|
||||
@@ -139,6 +152,10 @@ const buildExec = () => {
|
||||
}
|
||||
if (overridePr) {
|
||||
execArgs.push('-P', `${overridePr}`);
|
||||
} else if (
|
||||
`${context.eventName}` == 'pull_request_target'
|
||||
) {
|
||||
execArgs.push('-P', `${context.payload.number}`);
|
||||
}
|
||||
if (overrideTag) {
|
||||
execArgs.push('-T', `${overrideTag}`);
|
||||
|
||||
1884
src/codecov
Normal file
1884
src/codecov
Normal file
File diff suppressed because it is too large
Load Diff
72
src/index.ts
72
src/index.ts
@@ -2,63 +2,47 @@ const core = require('@actions/core');
|
||||
const exec = require('@actions/exec');
|
||||
|
||||
const fs = require('fs');
|
||||
const request = require('requestretry');
|
||||
|
||||
import buildExec from './buildExec';
|
||||
|
||||
const codecovScript = fs.readFileSync(__dirname + '/codecov');
|
||||
|
||||
let failCi;
|
||||
try {
|
||||
request({
|
||||
json: false,
|
||||
maxAttempts: 10,
|
||||
timeout: 3000,
|
||||
url: 'https://codecov.io/bash',
|
||||
}, (error, response, body) => {
|
||||
const {execArgs, options, filepath, failCi} = buildExec();
|
||||
const {execArgs, options, filepath, failCi} = buildExec();
|
||||
|
||||
try {
|
||||
if (error && failCi) {
|
||||
throw error;
|
||||
} else if (error) {
|
||||
core.warning(`Codecov warning: ${error.message}`);
|
||||
}
|
||||
fs.writeFile(filepath, codecovScript, (err) => {
|
||||
if (err && failCi) {
|
||||
throw err;
|
||||
} else if (err) {
|
||||
core.warning(`Codecov warning: ${err.message}`);
|
||||
}
|
||||
|
||||
fs.writeFile(filepath, body, (err) => {
|
||||
exec.exec('bash', execArgs, options)
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
if (failCi) {
|
||||
core.setFailed(
|
||||
`Codecov failed with the following error: ${err.message}`,
|
||||
);
|
||||
} else {
|
||||
core.warning(`Codecov warning: ${err.message}`);
|
||||
}
|
||||
})
|
||||
.then((status) => {
|
||||
console.log(status);
|
||||
unlinkFile();
|
||||
});
|
||||
|
||||
const unlinkFile = () => {
|
||||
fs.unlink(filepath, (err) => {
|
||||
if (err && failCi) {
|
||||
throw err;
|
||||
} else if (err) {
|
||||
core.warning(`Codecov warning: ${err.message}`);
|
||||
}
|
||||
|
||||
exec.exec('bash', execArgs, options)
|
||||
.catch((err) => {
|
||||
if (failCi) {
|
||||
core.setFailed(
|
||||
`Codecov failed with the following error: ${err.message}`,
|
||||
);
|
||||
} else {
|
||||
core.warning(`Codecov warning: ${err.message}`);
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
unlinkFile();
|
||||
});
|
||||
|
||||
const unlinkFile = () => {
|
||||
fs.unlink(filepath, (err) => {
|
||||
if (err && failCi) {
|
||||
throw err;
|
||||
} else if (err) {
|
||||
core.warning(`Codecov warning: ${err.message}`);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
} catch (error) {
|
||||
core.setFailed(
|
||||
`Codecov failed with the following error: ${error.message}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
});
|
||||
} catch (error) {
|
||||
if (failCi) {
|
||||
|
||||
3
src/version.ts
Normal file
3
src/version.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
const VERSION = 'v1.5.2';
|
||||
|
||||
export default VERSION;
|
||||
Reference in New Issue
Block a user