Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/allow for other cli args #191

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ jobs:
flags: backend
- codecov/upload:
cli_args: -v
commit_args: -Z
file: coverage/coverage-final.json
flags: frontend
report_args: -Z
upload_args: -Z
- codecov/upload:
file: coverage/coverage-final.json
Expand Down
12 changes: 12 additions & 0 deletions src/commands/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ parameters:
(e.g. `-v`).
type: string
default: ""
commit_args:
description: Any arguments provided to the create-commit step of the CLI
(e.g. `--git-service github-enterprise`).
type: string
default: ""
file:
description: Path to the code coverage data file to upload.
type: string
Expand All @@ -22,6 +27,11 @@ parameters:
environment variables.
type: string
default: ""
report_args:
description: Any arguments provided to the create-report step of the CLI
(e.g. `--git-service github-enterprise`).
type: string
default: ""
token:
description: Set the private repository token as the value of the
variable CODECOV_TOKEN using CircleCI Environment Variables.
Expand Down Expand Up @@ -69,8 +79,10 @@ steps:
command: <<include(scripts/upload.sh)>>
environment:
PARAM_CLI_ARGS: << parameters.cli_args >>
PARAM_COMMIT_ARGS: << parameters.commit_args >>
PARAM_FILE: << parameters.file >>
PARAM_FLAGS: << parameters.flags >>
PARAM_REPORT_ARGS: << parameters.report_args >>
PARAM_TOKEN: << parameters.token >>
PARAM_UPLOAD_ARGS: << parameters.upload_args >>
PARAM_UPLOAD_NAME: << parameters.upload_name >>
6 changes: 4 additions & 2 deletions src/scripts/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ echo "./\"$codecov_filename\" ${PARAM_CLI_ARGS} create-commit -t <redacted>"
./"$codecov_filename" \
${PARAM_CLI_ARGS} \
create-commit \
-t "$(eval echo \$$PARAM_TOKEN)"
-t "$(eval echo \$$PARAM_TOKEN)" \
${PARAM_COMMIT_ARGS}

#create report
echo "./\"$codecov_filename\" ${PARAM_CLI_ARGS} create-report -t <redacted>"

./"$codecov_filename" \
${PARAM_CLI_ARGS} \
create-report \
-t "$(eval echo \$$PARAM_TOKEN)"
-t "$(eval echo \$$PARAM_TOKEN)" \
${PARAM_REPORT_ARGS}

#upload reports
# alpine doesn't allow for indirect expansion
Expand Down
Loading