feat: add gcov support

This commit is contained in:
Tom Hu
2022-04-04 16:14:50 -04:00
parent f32b3a3741
commit f37520c6b0
10 changed files with 75 additions and 7 deletions

View File

@@ -1,3 +1,9 @@
## 2.2.0
### Features
- # Incorporate `gcov` arguments for the Codecov uploader
### Dependencies
## 2.1.0 ## 2.1.0
### Features ### Features
- #515 Allow specifying version of Codecov uploader - #515 Allow specifying version of Codecov uploader

View File

@@ -3,5 +3,5 @@ deploy:
git tag -d v2 git tag -d v2
git push origin :v2 git push origin :v2
git tag v2 git tag v2
git tag v$(VERSION) -m "" git tag v$(VERSION) -s -m ""
git push origin --tags git push origin --tags

View File

@@ -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 | `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 -| `functionalities` | Toggle functionalities | Optional
-| | `network` Disable uploading the file network | -| | `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 | `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional
| `name` | Custom defined name for the upload | Optional | `name` | Custom defined name for the upload | Optional
| `override_branch` | Specify the branch name | Optional | `override_branch` | Specify the branch name | Optional

View File

@@ -32,6 +32,18 @@ inputs:
functionalities: functionalities:
description: 'Comma-separated list, see the README for options and their usage' description: 'Comma-separated list, see the README for options and their usage'
required: false 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: move_coverage_to_trash:
description: 'Move discovered coverage reports to the trash' description: 'Move discovered coverage reports to the trash'
required: false required: false

18
dist/index.js vendored
View File

@@ -12879,7 +12879,7 @@ var core = __nccwpck_require__(2186);
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js // EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
var github = __nccwpck_require__(5438); var github = __nccwpck_require__(5438);
;// CONCATENATED MODULE: ./package.json ;// CONCATENATED MODULE: ./package.json
const package_namespaceObject = {"i8":"2.1.0"}; const package_namespaceObject = {"i8":"2.2.0"};
;// CONCATENATED MODULE: ./src/buildExec.ts ;// CONCATENATED MODULE: ./src/buildExec.ts
@@ -12902,6 +12902,10 @@ const buildExec = () => {
const file = core.getInput('file'); const file = core.getInput('file');
const files = core.getInput('files'); const files = core.getInput('files');
const flags = core.getInput('flags'); 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 functionalities = core.getInput('functionalities');
const name = core.getInput('name'); const name = core.getInput('name');
const os = core.getInput('os'); const os = core.getInput('os');
@@ -12973,6 +12977,18 @@ const buildExec = () => {
execArgs.push('-F', `${f}`); 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) { if (overrideBranch) {
execArgs.push('-B', `${overrideBranch}`); execArgs.push('-B', `${overrideBranch}`);
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

5
package-lock.json generated
View File

@@ -1,11 +1,12 @@
{ {
"name": "codecov-action", "name": "codecov-action",
"version": "2.1.0", "version": "2.2.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "2.1.0", "name": "codecov-action",
"version": "2.2.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.5.0", "@actions/core": "^1.5.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "codecov-action", "name": "codecov-action",
"version": "2.1.0", "version": "2.2.0",
"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": {
@@ -16,7 +16,7 @@
"url": "git+https://github.com/codecov/codecov-action.git" "url": "git+https://github.com/codecov/codecov-action.git"
}, },
"keywords": [], "keywords": [],
"author": "Ibrahim Ali", "author": "Codecov",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/codecov/codecov-action/issues" "url": "https://github.com/codecov/codecov-action/issues"

View File

@@ -35,6 +35,10 @@ test('all arguments', () => {
'flags': 'test,test2', 'flags': 'test,test2',
'functionalities': 'functionalities':
'network', 'network',
'gcov': 'true',
'gcov_args': '-v',
'gcov_ignore': '*.fake',
'gcov_include': 'real_file',
'move_coverage_to_trash': 'true', 'move_coverage_to_trash': 'true',
'name': 'codecov', 'name': 'codecov',
'override_branch': 'thomasrockhu/test', 'override_branch': 'thomasrockhu/test',
@@ -80,6 +84,13 @@ test('all arguments', () => {
'test', 'test',
'-F', '-F',
'test2', 'test2',
'-g',
'-ga',
'-v',
'-gi',
'*.fake',
'-gI',
'real_file',
'-B', '-B',
'thomasrockhu/test', 'thomasrockhu/test',
'-b', '-b',

View File

@@ -25,6 +25,10 @@ const buildExec = () => {
const file = core.getInput('file'); const file = core.getInput('file');
const files = core.getInput('files'); const files = core.getInput('files');
const flags = core.getInput('flags'); 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 functionalities = core.getInput('functionalities');
const name = core.getInput('name'); const name = core.getInput('name');
const os = core.getInput('os'); const os = core.getInput('os');
@@ -105,6 +109,20 @@ const buildExec = () => {
execArgs.push('-F', `${f}`); 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) { if (overrideBranch) {
execArgs.push('-B', `${overrideBranch}`); execArgs.push('-B', `${overrideBranch}`);
} }