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

feat: update Orb to be encapsulated by a single script and port all the necessary arguments #207

Merged
merged 31 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6adc79e
fix: try 0.0.2
thomasrockhu-codecov Oct 2, 2024
e5aa1a3
fix: add yaml ---
thomasrockhu-codecov Oct 2, 2024
f8311f9
fix: try 0.0.3
thomasrockhu-codecov Oct 2, 2024
637ea84
fix: try 0.0.5
thomasrockhu-codecov Oct 2, 2024
2b17b83
fix: include scripts in the env
thomasrockhu-codecov Oct 2, 2024
436f412
fix: yamllint
thomasrockhu-codecov Oct 2, 2024
6e35daa
fix: 0.0.6
thomasrockhu-codecov Oct 3, 2024
45c63b1
fix: 0.0.7
thomasrockhu-codecov Oct 3, 2024
7027f0e
fix: try to pass it in as a var
thomasrockhu-codecov Oct 3, 2024
4c8f05f
fix: try 0.0.8
thomasrockhu-codecov Oct 3, 2024
a54ba89
fix: 0.0.9
thomasrockhu-codecov Oct 3, 2024
d8fb455
fix: 0.0.10
thomasrockhu-codecov Oct 3, 2024
f0d7531
fix: 0.0.11
thomasrockhu-codecov Oct 3, 2024
551c677
fix: 0.0.13
thomasrockhu-codecov Oct 3, 2024
03fe767
fix: update all the args
thomasrockhu-codecov Oct 4, 2024
33afeb4
fix: line-length
thomasrockhu-codecov Oct 4, 2024
7f3082c
fix: linting
thomasrockhu-codecov Oct 4, 2024
ec332cd
fix: upload_name
thomasrockhu-codecov Oct 4, 2024
4814d76
fix: packing
thomasrockhu-codecov Oct 4, 2024
1b2aa01
fix: use boolean
thomasrockhu-codecov Oct 4, 2024
4b40871
fix: 0.0.15 and small fixes
thomasrockhu-codecov Oct 4, 2024
5810c60
fix: add verbose
thomasrockhu-codecov Oct 4, 2024
3ef81f2
fix: 0.0.16
thomasrockhu-codecov Oct 4, 2024
aad3a1d
fix: is something wrong with verbose?
thomasrockhu-codecov Oct 4, 2024
5b3f941
fix: truthy is 1?
thomasrockhu-codecov Oct 4, 2024
f5f6b84
fix: 0.0.17
thomasrockhu-codecov Oct 4, 2024
5d54ab3
fix: use the script version
thomasrockhu-codecov Oct 4, 2024
6ce41e0
Update src/commands/upload.yml
thomasrockhu-codecov Oct 4, 2024
c370311
Update src/commands/upload.yml
thomasrockhu-codecov Oct 4, 2024
0fde191
Update src/commands/upload.yml
drazisil-codecov Oct 4, 2024
b6d9aa8
fix: fixes based on comments
thomasrockhu-codecov Oct 4, 2024
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
41 changes: 20 additions & 21 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2.1
orbs:
codecov: codecov/codecov@dev:alpha
Expand Down Expand Up @@ -56,12 +57,12 @@ jobs:
- codecov/upload:
flags: backend
- codecov/upload:
cli_args: -v
file: coverage/coverage-final.json
fail_on_error: true
files: coverage/coverage-final.json
flags: frontend
upload_args: -Z
verbose: true
- codecov/upload:
file: coverage/coverage-final.json
files: coverage/coverage-final.json
flags: alpine
version: v0.2.2
- codecov/upload:
Expand All @@ -79,14 +80,12 @@ jobs:
- codecov/upload:
flags: backend
- codecov/upload:
cli_args: -v
commit_args: -Z
file: coverage/coverage-final.json
fail_on_error: true
files: coverage/coverage-final.json
flags: frontend
report_args: -Z
upload_args: -Z
verbose: true
- codecov/upload:
file: coverage/coverage-final.json
files: coverage/coverage-final.json
flags: linux
version: v0.7.4
- codecov/upload:
Expand All @@ -104,12 +103,12 @@ jobs:
- codecov/upload:
flags: backend
- codecov/upload:
cli_args: -v
file: coverage/coverage-final.json
fail_on_error: true
files: coverage/coverage-final.json
flags: frontend
upload_args: -Z
verbose: true
- codecov/upload:
file: coverage/coverage-final.json
files: coverage/coverage-final.json
flags: macos
version: v0.7.4
- codecov/upload:
Expand All @@ -128,12 +127,12 @@ jobs:
- codecov/upload:
flags: backend
- codecov/upload:
cli_args: -v
file: coverage/coverage-final.json
fail_on_error: true
files: coverage/coverage-final.json
flags: frontend
upload_args: -Z
verbose: true
- codecov/upload:
file: coverage/coverage-final.json
files: coverage/coverage-final.json
flags: windows
version: v0.2.2
- codecov/upload:
Expand All @@ -149,9 +148,9 @@ workflows:
filters: *filters
- test-frontend:
filters: *filters
# - test-alpine:
# filters: *filters
# requires: [test-backend, test-frontend]
# - test-alpine:
# filters: *filters
# requires: [test-backend, test-frontend]
- test-linux:
filters:
branches:
Expand Down
1 change: 1 addition & 0 deletions src/@orb.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2.1

description: >
Expand Down
194 changes: 147 additions & 47 deletions src/commands/upload.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# yamllint disable rule:line-length
description: |
Upload your coverage reports to Codecov without dealing with complex
configurations. This orb helps you get coverage results quickly so that you
Expand All @@ -7,29 +9,120 @@ description: |
`gnupg` in order to validate.

parameters:
cli_args:
description: Any extra arguments provided to the CLI the CLI
(e.g. `-v`).
binary:
description: The file location of a pre-downloaded version of the CLI. If specified, integrity checking will be bypassed.
type: string
default: ""
commit_args:
description: Any arguments provided to the create-commit step of the CLI
(e.g. `--git-service github-enterprise`).
branch:
description: Branch to which this commit belongs
type: string
default: ""
file:
description: Path to the code coverage data file to upload.
build:
description: Specify the build number manually
type: string
default: ""
build_url:
description: The URL of the build where this is running
type: string
default: ""
code:
description: The code of the report if using local upload. If unsure, leave default. Read more here https://docs.codecov.com/docs/the-codecov-cli#how-to-use-local-upload
type: string
default: ""
dir:
description: Folder to search for coverage files. Default to the current working directory
type: string
default: ""
disable_file_fixes:
description: Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets). Read more here https://docs.codecov.com/docs/fixing-reports
type: boolean
default: false
disable_search:
description: Disable search for coverage files. This is helpful when specifying what files you want to upload with the files option.
type: boolean
default: false
dry_run:
description: Don't upload files to Codecov.
type: boolean
default: false
enterprise_url:
description: Set to the Codecov instance URl. Only applicable to some Enterprise users.
type: string
default: ""
env:
description: Specify environment variables to be included with this build
type: string
default: ""
excludes:
description: Comma-separated list of folders to exclude from search.
type: string
default: ""
fail_on_error:
description: Exit with non-zero code in case of error.
type: boolean
default: false
files:
description: Comma-separated list of explicit files to upload. These will be added to the coverage files found for upload. If you wish to only upload the specified files, please consider using disable-search to disable uploading other files.
type: string
default: ""
flags:
description: Flag the upload to group coverage metrics (e.g. unittests
| integration | ui,chrome). Flags can be input as strings or
environment variables.
description: Comma-separated list of flags to upload to group coverage metrics.
type: string
default: ""
git_service:
description: One of [github|gitlab|bitbucket|github_enterprise|gitlab_enterprise|bitbucket_server]
type: string
default: ""
handle_no_reports_found:
description: Raise no exceptions when no coverage reports are found.
type: boolean
default: false
job_code:
description:
type: string
default: ""
legacy:
description: Use the legacy upload endpoint.
type: boolean
default: false
network_filter:
description: Specify a filter on the files listed in the network section of the Codecov report. This will only add files whose path begin with the specified filter. Useful for upload-specific path fixing.
drazisil-codecov marked this conversation as resolved.
Show resolved Hide resolved
type: string
default: ""
network_prefix:
description: Specify a prefix on files listed in the network section of the Codecov report. Useful to help resolve path fixing.
type: string
default: ""
network_root_folder:
description: Root folder from which to consider paths on the network section. Defaults to current working directory.
type: string
default: ""
parent_sha:
description: SHA (with 40 chars) of what should be the parent of this commit.
type: string
default: ""
plugins:
description: Comma-separated list of plugins to run. Specify `noop` to turn off all plugins
type: string
default: ""
pr:
description: Specify the pull request number manually. Used to override pre-existing CI 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`).
report_type:
description: The type of file to upload, coverage by default. Possible values are "testing", "coverage".
type: string
default: "coverage"
sha:
description: Commit SHA (with 40 chars)
type: string
default: ""
skip_validation:
description: Skip integrity checking of the CLI. This is NOT recommended.
type: boolean
default: false
slug:
description: Set to the owner/repo slug used instead of the private repo token. Only applicable to some Enterprise users.
type: string
default: ""
token:
Expand All @@ -38,20 +131,15 @@ parameters:
type: env_var_name
default: CODECOV_TOKEN
upload_name:
description: Custom defined name of the upload. Visible in Codecov UI
type: string
default: ""
upload_args:
description: Any extra flags as provided to the `do-upload` step of the CLI
description: Custom defined name of the upload. Visible in the Codecov UI
type: string
default: ""
validate:
description: Validate the uploader before uploading the codecov result.
verbose:
description: Use verbose logging in the CLI
type: boolean
default: true
default: false
version:
description: Which version of the Codecov Uploader to use (defaults to
'latest')
description: Which version of the Codecov CLI to use (defaults to 'latest')
type: string
default: "latest"
when:
Expand All @@ -61,28 +149,40 @@ parameters:

steps:
- run:
name: Download Codecov Uploader
command: <<include(scripts/download.sh)>>
name: Upload to Codecov
command: <<include(scripts/dist/codecov.sh)>>
when: << parameters.when >>
environment:
PARAM_VERSION: << parameters.version >>
- when:
condition: << parameters.validate >>
steps:
- run:
name: Validate Codecov Uploader
command: <<include(scripts/validate.sh)>>
environment:
CODECOV_PUBLIC_PGP_KEY: <<include(scripts/pgp_keys.asc)>>
- run:
name: Upload Coverage Results
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 >>
CC_BINARY: << parameters.binary >>
CC_BRANCH: << parameters.branch >>
CC_BUILD: << parameters.build >>
CC_BUILD_URL: << parameters.build_url >>
CC_CODE: << parameters.code >>
CC_DIR: << parameters.dir >>
CC_DISABLE_FILE_FIXES: << parameters.disable_file_fixes >>
CC_DISABLE_SEARCH: << parameters.disable_search >>
CC_DRY_RUN: << parameters.dry_run >>
CC_ENTERPRISE_URL: << parameters.enterprise_url >>
CC_ENV: << parameters.env >>
CC_EXCLUDES: << parameters.excludes >>
CC_FAIL_ON_ERROR: << parameters.fail_on_error >>
CC_FILES: << parameters.files >>
CC_FLAGS: << parameters.flags >>
CC_GIT_SERVICE: << parameters.git_service >>
CC_HANDLE_NO_REPORTS_FOUND: << parameters.handle_no_reports_found >>
CC_JOB_CODE: << parameters.job_code >>
CC_LEGACY: << parameters.legacy >>
CC_NAME: << parameters.upload_name >>
CC_NETWORK_FILTER: << parameters.network_filter >>
CC_NETWORK_PREFIX: << parameters.network_prefix >>
CC_NETWORK_ROOT_FOLDER: << parameters.network_root_folder >>
CC_PARENT_SHA: << parameters.parent_sha >>
CC_PLUGINS: << parameters.plugins >>
CC_PR: << parameters.pr >>
CC_REPORT_TYPE: << parameters.report_type >>
CC_SHA: << parameters.sha >>
CC_SKIP_VALIDATION: << parameters.skip_validation >>
CC_SLUG: << parameters.slug >>
CC_TOKEN_VAR: << parameters.token >>
CC_VERBOSE: << parameters.verbose >>
CC_VERSION: << parameters.version >>
Loading