Skip to content

Commit

Permalink
feat: add plugins (#1099)
Browse files Browse the repository at this point in the history
* feat: add plugins

* fix: add test
  • Loading branch information
thomasrockhu-codecov authored Sep 22, 2023
1 parent 572779f commit 428cda1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ inputs:
override_pr:
description: 'Specify the pull request number'
required: false
plugins:
description: 'Comma-separated list of plugins for use during upload.'
required: false
root_dir:
description: 'Used when not in git/hg project to identify project root directory'
required: false
Expand Down
18 changes: 10 additions & 8 deletions dist/index.js

Large diffs are not rendered by default.

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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codecov-action",
"version": "4.0.0-beta.2",
"version": "4.0.0-beta.3",
"description": "Upload coverage reports to Codecov from GitHub Actions",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions src/buildExec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ test('upload args', () => {
'override_build': '1',
'override_commit': '9caabca5474b49de74ef5667deabaf74cdacc244',
'override_pr': '2',
'plugins': 'pycoverage,compress-pycoverage',
'root_dir': 'root/',
'slug': 'fakeOwner/fakeRepo',
'token': 'd3859757-ab80-4664-924d-aef22fa7557b',
Expand Down Expand Up @@ -99,6 +100,10 @@ test('upload args', () => {
'9caabca5474b49de74ef5667deabaf74cdacc244',
'-P',
'2',
'--plugin',
'pycoverage',
'--plugin',
'compress-pycoverage',
'--network-root-folder',
'root/',
'-s',
Expand Down
6 changes: 6 additions & 0 deletions src/buildExec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const buildUploadExec = () => {
const overrideBuild = core.getInput('override_build');
const overrideCommit = core.getInput('override_commit');
const overridePr = core.getInput('override_pr');
const plugins = core.getInput('plugins');
const rootDir = core.getInput('root_dir');
const searchDir = core.getInput('directory');
const slug = core.getInput('slug');
Expand Down Expand Up @@ -220,6 +221,11 @@ const buildUploadExec = () => {
) {
uploadExecArgs.push('-P', `${context.payload.number}`);
}
if (plugins) {
plugins.split(',').map((p) => p.trim()).forEach((p) => {
uploadExecArgs.push('--plugin', `${p}`);
});
}
if (rootDir) {
uploadExecArgs.push('--network-root-folder', `${rootDir}`);
}
Expand Down

0 comments on commit 428cda1

Please sign in to comment.