Skip to content

Commit

Permalink
Merge pull request #688 from codecov/feat/gcov
Browse files Browse the repository at this point in the history
Incorporate `gcov` arguments for the Codecov uploader
  • Loading branch information
thomasrockhu-codecov committed Apr 4, 2022
2 parents b049ab5 + 9e4b071 commit c3d4062
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 7 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,15 @@
## 2.2.0
### Features
- #688 Incorporate `gcov` arguments for the Codecov uploader

### Dependencies
- #548 build(deps-dev): bump jest-junit from 12.2.0 to 13.0.0
- #603 [Snyk] Upgrade @actions/core from 1.5.0 to 1.6.0
- #628 build(deps): bump node-fetch from 2.6.1 to 3.1.1
- #634 build(deps): bump node-fetch from 3.1.1 to 3.2.0
- #636 build(deps): bump openpgp from 5.0.1 to 5.1.0
- #653 build(deps-dev): bump @types/node from 16.11.21 to 17.0.18

## 2.1.0
### Features
- #515 Allow specifying version of Codecov uploader
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -3,5 +3,5 @@ deploy:
git tag -d v2
git push origin :v2
git tag v2
git tag v$(VERSION) -m ""
git tag v$(VERSION) -s -m ""
git push origin --tags
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -61,6 +61,10 @@ 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
| `functionalities` | Toggle functionalities | Optional
| | `network` Disable uploading the file network |
| `gcov` | Run with gcov support |
| `gcov_args` | Extra arguments to pass to gcov |
| `gcov_ignore` | Paths to ignore during gcov gathering |
| `gcov_include` | Paths to include during gcov gathering |
| `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional
| `name` | Custom defined name for the upload | Optional
| `override_branch` | Specify the branch name | Optional
Expand Down
12 changes: 12 additions & 0 deletions action.yml
Expand Up @@ -32,6 +32,18 @@ inputs:
functionalities:
description: 'Comma-separated list, see the README for options and their usage'
required: false
gcov:
description: 'Run with gcov support'
required: false
gcov_args:
description: 'Extra arguments to pass to gcov'
required: false
gcov_ignore:
description: 'Paths to ignore during gcov gathering'
required: false
gcov_include:
description: 'Paths to include during gcov gathering'
required: false
move_coverage_to_trash:
description: 'Move discovered coverage reports to the trash'
required: false
Expand Down
18 changes: 17 additions & 1 deletion dist/index.js
Expand Up @@ -12879,7 +12879,7 @@ var core = __nccwpck_require__(2186);
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
var github = __nccwpck_require__(5438);
;// CONCATENATED MODULE: ./package.json
const package_namespaceObject = {"i8":"2.1.0"};
const package_namespaceObject = {"i8":"2.2.0"};
;// CONCATENATED MODULE: ./src/buildExec.ts


Expand All @@ -12902,6 +12902,10 @@ const buildExec = () => {
const file = core.getInput('file');
const files = core.getInput('files');
const flags = core.getInput('flags');
const gcov = core.getInput('gcov');
const gcovArgs = core.getInput('gcov_args');
const gcovIgnore = core.getInput('gcov_ignore');
const gcovInclude = core.getInput('gcov_include');
const functionalities = core.getInput('functionalities');
const name = core.getInput('name');
const os = core.getInput('os');
Expand Down Expand Up @@ -12973,6 +12977,18 @@ const buildExec = () => {
execArgs.push('-F', `${f}`);
});
}
if (gcov) {
execArgs.push('-g');
}
if (gcovArgs) {
execArgs.push('--ga', `${gcovArgs}`);
}
if (gcovIgnore) {
execArgs.push('--gi', `${gcovIgnore}`);
}
if (gcovInclude) {
execArgs.push('--gI', `${gcovInclude}`);
}
if (overrideBranch) {
execArgs.push('-B', `${overrideBranch}`);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "codecov-action",
"version": "2.1.0",
"version": "2.2.0",
"description": "Upload coverage reports to Codecov from GitHub Actions",
"main": "index.js",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"url": "git+https://github.com/codecov/codecov-action.git"
},
"keywords": [],
"author": "Ibrahim Ali",
"author": "Codecov",
"license": "MIT",
"bugs": {
"url": "https://github.com/codecov/codecov-action/issues"
Expand Down
11 changes: 11 additions & 0 deletions src/buildExec.test.ts
Expand Up @@ -35,6 +35,10 @@ test('all arguments', () => {
'flags': 'test,test2',
'functionalities':
'network',
'gcov': 'true',
'gcov_args': '-v',
'gcov_ignore': '*.fake',
'gcov_include': 'real_file',
'move_coverage_to_trash': 'true',
'name': 'codecov',
'override_branch': 'thomasrockhu/test',
Expand Down Expand Up @@ -80,6 +84,13 @@ test('all arguments', () => {
'test',
'-F',
'test2',
'-g',
'--ga',
'-v',
'--gi',
'*.fake',
'--gI',
'real_file',
'-B',
'thomasrockhu/test',
'-b',
Expand Down
18 changes: 18 additions & 0 deletions src/buildExec.ts
Expand Up @@ -25,6 +25,10 @@ const buildExec = () => {
const file = core.getInput('file');
const files = core.getInput('files');
const flags = core.getInput('flags');
const gcov = core.getInput('gcov');
const gcovArgs = core.getInput('gcov_args');
const gcovIgnore = core.getInput('gcov_ignore');
const gcovInclude = core.getInput('gcov_include');
const functionalities = core.getInput('functionalities');
const name = core.getInput('name');
const os = core.getInput('os');
Expand Down Expand Up @@ -105,6 +109,20 @@ const buildExec = () => {
execArgs.push('-F', `${f}`);
});
}

if (gcov) {
execArgs.push('-g');
}
if (gcovArgs) {
execArgs.push('--ga', `${gcovArgs}`);
}
if (gcovIgnore) {
execArgs.push('--gi', `${gcovIgnore}`);
}
if (gcovInclude) {
execArgs.push('--gI', `${gcovInclude}`);
}

if (overrideBranch) {
execArgs.push('-B', `${overrideBranch}`);
}
Expand Down

0 comments on commit c3d4062

Please sign in to comment.