From 2253d2f7e1e5bb327d26f20c03842020e4ba296e Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Thu, 17 Oct 2024 17:08:34 -0500 Subject: [PATCH] feat: migrate to wrapper and CLI --- .bitrise.secrets.yml | 1 + .gitmodules | 4 + bitrise.yml | 101 +++++----- {commit-hooks => hooks}/pre-commit | 4 + src/scripts | 1 + step.sh | 306 +++++++++++++++++++++-------- step.yml | 275 ++++++++++++++++++++++++-- 7 files changed, 543 insertions(+), 149 deletions(-) create mode 100644 .gitmodules rename {commit-hooks => hooks}/pre-commit (56%) create mode 160000 src/scripts diff --git a/.bitrise.secrets.yml b/.bitrise.secrets.yml index ab6fd047..063f5ef8 100644 --- a/.bitrise.secrets.yml +++ b/.bitrise.secrets.yml @@ -1,2 +1,3 @@ +--- envs: - CODECOV_TOKEN: fake diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..d2fd8e1e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "src/scripts"] + path = src/scripts + url = https://github.com/codecov/wrapper + branch = main diff --git a/bitrise.yml b/bitrise.yml index 6f638d65..e9f7850a 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -1,62 +1,63 @@ +--- format_version: "5" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git app: envs: - - CI_OPTIONS: -Z - - LOCAL_OPTIONS: -Z -d - - OS: macos + - CI_OPTIONS: -Z + - LOCAL_OPTIONS: -Z -d + - OS: macos workflows: test-ci: steps: - - activate-ssh-key@4: - run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' - - git-clone@8: {} - - script: - inputs: - - content: |- - pip3 install -r app/requirements.txt - pytest --cov app - - path::/Users/vagrant/git: - title: Step Test - run_if: true - is_skippable: false - inputs: - - CODECOV_TOKEN: $CODECOV_TOKEN - - OS: $OS - - other_options: $CI_OPTIONS - - script: - title: Step audit - inputs: - - content: |- - #!/bin/bash - set -ex - stepman audit --step-yml ./step.yml + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@8: {} + - script: + inputs: + - content: |- + pip3 install -r app/requirements.txt + pytest --cov app + - path::/Users/vagrant/git: + title: Step Test + run_if: true + is_skippable: false + inputs: + - CODECOV_TOKEN: $CODECOV_TOKEN + - OS: $OS + - other_options: $CI_OPTIONS + - script: + title: Step audit + inputs: + - content: |- + #!/bin/bash + set -ex + stepman audit --step-yml ./step.yml test-local: steps: - - git-clone@8: {} - - script: - inputs: - - content: |- - pip3 install -r app/requirements.txt - pytest --cov app - - path::./: - title: Step Test - run_if: true - is_skippable: false - inputs: - - CODECOV_TOKEN: ${CODECOV_TOKEN} - - OS: $OS - - other_options: $LOCAL_OPTIONS + - git-clone@8: {} + - script: + inputs: + - content: |- + pip3 install -r app/requirements.txt + pytest --cov app + - path::./: + title: Step Test + run_if: true + is_skippable: false + inputs: + - CODECOV_TOKEN: ${CODECOV_TOKEN} + - OS: $OS + - other_options: $LOCAL_OPTIONS audit-this-step: steps: - - script: - inputs: - - content: |- - #!/bin/bash - set -ex - stepman audit --step-yml ./step.yml + - script: + inputs: + - content: |- + #!/bin/bash + set -ex + stepman audit --step-yml ./step.yml trigger_map: -- push_branch: main - workflow: test-ci -- pull_request_target_branch: main - workflow: test-ci + - push_branch: main + workflow: test-ci + - pull_request_target_branch: main + workflow: test-ci diff --git a/commit-hooks/pre-commit b/hooks/pre-commit similarity index 56% rename from commit-hooks/pre-commit rename to hooks/pre-commit index ad440194..f927bac2 100755 --- a/commit-hooks/pre-commit +++ b/hooks/pre-commit @@ -2,6 +2,10 @@ set -e +cp src/scripts/dist/codecov.sh ./step.sh +chmod u+x step.sh +git add step.sh + bitrise validate bitrise run audit-this-step bitrise run test-local diff --git a/src/scripts b/src/scripts new file mode 160000 index 00000000..25915172 --- /dev/null +++ b/src/scripts @@ -0,0 +1 @@ +Subproject commit 25915172214291288591bd31da67a88320171e58 diff --git a/step.sh b/step.sh index f19b6146..557a001b 100755 --- a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ltTBoMPyv4f3X/wCQ= -=ch7z ------END PGP PUBLIC KEY BLOCK-----" - -# Download and verify Codecov uploader -echo "${CODECOV_PUBLIC_PGP_KEY}" | gpg --no-default-keyring --import # One-time step -curl -Os "https://cli.codecov.io/${VERSION}/${OS}/codecov" -curl -Os "https://cli.codecov.io/${VERSION}/${OS}/codecov.SHA256SUM" -curl -Os "https://cli.codecov.io/${VERSION}/${OS}/codecov.SHA256SUM.sig" -gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM -shasum -a 256 -c codecov.SHA256SUM - -chmod +x codecov - -curl -H "Accept: application/json" "https://cli.codecov.io/${OS}/${VERSION}" | grep -o '\"version\":\"v[0-9\.\_]\+\"' | head -1 - -#create commit in codecov -./codecov create-commit -t ${CODECOV_TOKEN} - -#create report -./codecov create-report -t ${CODECOV_TOKEN} - -echo "-Z ${other_options}" "${@}" - -# Upload coverage to Codecov -./codecov do-upload -t ${CODECOV_TOKEN} -Z ${other_options} "${@}" +#!/usr/bin/env bash +CC_WRAPPER_VERSION="0.0.18" +say() { + echo -e "$1" +} +exit_if_error() { + say "$r==> $1$x" + if [ $CC_FAIL_ON_ERROR = true ]; + then + say "$r Exiting...$x" + exit 1; + fi +} +lower() { + echo $(echo $1 | sed 's/CC//' | sed 's/_/-/g' | tr '[:upper:]' '[:lower:]') +} +write_existing_args() { + if [ -n "$(eval echo \$$1)" ]; + then + echo " -$(lower "$1") $(eval echo \$$1)" + fi +} +write_truthy_args() { + if [ "$(eval echo \$$1)" = "true" ] || [ "$(eval echo \$$1)" = "1" ]; + then + echo " -$(lower $1)" + fi +} +b="\033[0;36m" # variables/constants +g="\033[0;32m" # info/debug +r="\033[0;31m" # errors +x="\033[0m" +say " _____ _ + / ____| | | + | | ___ __| | ___ ___ _____ __ + | | / _ \\ / _\` |/ _ \\/ __/ _ \\ \\ / / + | |___| (_) | (_| | __/ (_| (_) \\ V / + \\_____\\___/ \\__,_|\\___|\\___\\___/ \\_/ + $r Wrapper-$CC_WRAPPER_VERSION$x + " +CC_VERSION="${CC_VERSION:-latest}" +CC_FAIL_ON_ERROR="${CC_FAIL_ON_ERROR:-false}" +if [ -n "$CC_BINARY" ]; +then + if [ -f "$CC_BINARY" ]; + then + cc_filename=$CC_BINARY + else + exit_if_error "Could not find binary file $CC_BINARY" + fi +else + family=$(uname -s | tr '[:upper:]' '[:lower:]') + cc_os="windows" + [[ $family == "darwin" ]] && cc_os="macos" + [[ $family == "linux" ]] && cc_os="linux" + [[ $cc_os == "linux" ]] && \ + osID=$(grep -e "^ID=" /etc/os-release | cut -c4-) + [[ $osID == "alpine" ]] && cc_os="alpine" + [[ $(arch) == "aarch64" && $family == "linux" ]] && cc_os+="-arm64" + say "$g==>$x Detected $b${cc_os}$x" + export cc_os=${cc_os} + export cc_version=${CC_VERSION} + cc_filename="codecov" + [[ $cc_os == "windows" ]] && cc_filename+=".exe" + export cc_filename=${cc_filename} + [[ $cc_os == "macos" ]] && \ + ! command -v gpg 2>&1 >/dev/null && \ + HOMEBREW_NO_AUTO_UPDATE=1 brew install gpg + cc_url="https://cli.codecov.io" + cc_url="$cc_url/${CC_VERSION}" + cc_url="$cc_url/${cc_os}/${cc_filename}" + say "$g ->$x Downloading $b${cc_url}$x" + curl -Os $cc_url + say "$g==>$x Finishing downloading $b${cc_os}:${CC_VERSION}$x" + say " " +fi +if [ "$CC_SKIP_VALIDATION" = "true" ] || [ -n "$CC_BINARY" ]; +then + say "$r==>$x Bypassing validation as requested by user" +else +CC_PUBLIC_PGP_KEY=$(curl https://keybase.io/codecovsecurity/pgp_keys.asc) + echo "${CC_PUBLIC_PGP_KEY}" | \ + gpg --no-default-keyring --import + # One-time step + say "$g==>$x Verifying GPG signature integrity" + sha_url="https://cli.codecov.io" + sha_url="${sha_url}/${cc_version}/${cc_os}" + sha_url="${sha_url}/${cc_filename}.SHA256SUM" + say "$g ->$x Downloading $b${sha_url}$x" + say "$g ->$x Downloading $b${sha_url}.sig$x" + say " " + curl -Os "$sha_url" + curl -Os "${sha_url}.sig" + if ! gpg --verify "${cc_filename}.SHA256SUM.sig" "${cc_filename}.SHA256SUM"; + then + exit_if_error "Could not verify signature. Please contact Codecov if problem continues" + fi + if ! (shasum -a 256 -c "${cc_filename}.SHA256SUM" || \ + sha256sum -c "${cc_filename}.SHA256SUM"); + then + exit_if_error "Could not verify SHASUM. Please contact Codecov if problem continues" + fi + say "$g==>$x CLI integrity verified" + say +fi +cc_cli_args=() +cc_cli_args+=( $(write_existing_args CC_AUTO_LOAD_PARAMS_FROM) ) +cc_cli_args+=( $(write_existing_args CC_ENTERPRISE_URL) ) +cc_cli_args+=( $(write_existing_args CC_YML_PATH) ) +cc_cli_args+=( $(write_truthy_args CC_VERBOSE) ) +cc_cc_args=() +cc_cc_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) +cc_cc_args+=( $(write_existing_args CC_GIT_SERVICE) ) +cc_cc_args+=( $(write_existing_args CC_PARENT_SHA) ) +cc_cc_args+=( $(write_existing_args CC_PR) ) +cc_cc_args+=( $(write_existing_args CC_SHA) ) +cc_cc_args+=( $(write_existing_args CC_SLUG) ) +cc_create_report_args=() +cc_cr_args+=( $(write_existing_args CC_CODE) ) +cc_cr_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) +cc_cr_args+=( $(write_existing_args CC_GIT_SERVICE) ) +cc_cr_args+=( $(write_existing_args CC_PR) ) +cc_cr_args+=( $(write_existing_args CC_SHA) ) +cc_cr_args+=( $(write_existing_args CC_SLUG) ) +cc_du_args=() +OLDIFS=$IFS;IFS=, +cc_du_args+=( $(write_existing_args CC_BRANCH) ) +cc_du_args+=( $(write_existing_args CC_BUILD) ) +cc_du_args+=( $(write_existing_args CC_BUILD_URL) ) +cc_du_args+=( $(write_existing_args CC_CODE) ) +cc_du_args+=( $(write_existing_args CC_DIR) ) +cc_du_args+=( $(write_truthy_args CC_DISABLE_FILE_FIXES) ) +cc_du_args+=( $(write_truthy_args CC_DISABLE_SEARCH) ) +cc_du_args+=( $(write_truthy_args CC_DRY_RUN) ) +cc_du_args+=( $(write_existing_args CC_ENV) ) +if [ -n "$CC_EXCLUDES" ]; +then + for directory in $CC_EXCLUDES; do + cc_du_args+=( " --exclude " "$directory" ) + done +fi +cc_du_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) +if [ -n "$CC_FILES" ]; +then + for file in $CC_FILES; do + cc_du_args+=( " --file " "$file" ) + done +fi +if [ -n "$CC_FLAGS" ]; +then + for flag in $CC_FLAGS; do + cc_du_args+=( " --flag " "$flag" ) + done +fi +cc_du_args+=( $(write_existing_args CC_GCOV_ARGS) ) +cc_du_args+=( $(write_existing_args CC_GCOV_EXECUTABLE) ) +cc_du_args+=( $(write_existing_args CC_GCOV_IGNORE) ) +cc_du_args+=( $(write_existing_args CC_GCOV_INCLUDE) ) +cc_du_args+=( $(write_existing_args CC_GIT_SERVICE) ) +cc_du_args+=( $(write_truthy_args CC_HANDLE_NO_REPORTS_FOUND) ) +cc_du_args+=( $(write_existing_args CC_JOB_CODE) ) +cc_du_args+=( $(write_truthy_args CC_LEGACY) ) +cc_du_args+=( $(write_existing_args CC_NAME) ) +cc_du_args+=( $(write_existing_args CC_NETWORK_FILTER) ) +cc_du_args+=( $(write_existing_args CC_NETWORK_PREFIX) ) +cc_du_args+=( $(write_existing_args CC_NETWORK_ROOT_FOLDER) ) +if [ -n "$CC_PLUGINS" ]; +then + for plugin in $CC_PLUGINS; do + cc_du_args+=( " --plugin " "$plugin" ) + done +fi +cc_du_args+=( $(write_existing_args CC_PR) ) +cc_du_args+=( $(write_existing_args CC_REPORT_TYPE) ) +cc_du_args+=( $(write_existing_args CC_SHA) ) +cc_du_args+=( $(write_existing_args CC_SLUG) ) +cc_du_args+=( $(write_existing_args CC_SWIFT_PROJECT) ) +IFS=$OLDIFS +unset NODE_OPTIONS +# See https://github.com/codecov/uploader/issues/475 +chmod +x $cc_filename +if [ -n "$CC_TOKEN_VAR" ]; +then + token="$(eval echo \$$CC_TOKEN_VAR)" +else + token="$(eval echo $CC_TOKEN)" +fi +say "$g ->$x Token of length ${#token} detected" +token_str="" +token_arg=() +if [ -n "$token" ]; +then + token_str+=" -t " + token_arg+=( " -t " "$token") +fi +say "$g==>$x Running create-commit" +say " $b./$cc_filename $(echo "${cc_cli_args[@]}") create-commit$token_str $(echo "${cc_cc_args[@]}")$x" +if ! ./$cc_filename \ + ${cc_cli_args[*]} \ + create-commit \ + ${token_arg[*]} \ + ${cc_cc_args[*]}; +then + exit_if_error "Failed to create-commit" +fi +say " " +say "$g==>$x Running create-report" +say " $b./$cc_filename $(echo "${cc_cli_args[@]}") create-report$token_str $(echo "${cc_cr_args[@]}")$x" +if ! ./$cc_filename \ + ${cc_cli_args[*]} \ + create-report \ + ${token_arg[*]} \ + ${cc_cr_args[*]}; +then + exit_if_error "Failed to create-report" +fi +say " " +say "$g==>$x Running do-upload" +say " $b./$cc_filename $(echo "${cc_cli_args[@]}") do-upload$token_str $(echo "${cc_du_args[@]}")$x" +if ! ./$cc_filename \ + ${cc_cli_args[*]} \ + do-upload \ + ${token_arg[*]} \ + ${cc_du_args[*]}; +then + exit_if_error "Failed to upload" +fi diff --git a/step.yml b/step.yml index 1ae50e7d..0230e779 100644 --- a/step.yml +++ b/step.yml @@ -1,10 +1,13 @@ +--- +# yamllint disable rule:line-length title: Codecov summary: |- Upload your code coverage files to Codecov.io description: |- Reduce technical debt with visualized test performance, faster code reviews and workflow enhancements. - Now you can upload your code coverage files to Codecov every time you kick off a build! + Now you can upload your code coverage files to Codecov + every time you kick off a build! website: https://codecov.io source_code_url: https://github.com/codecov/codecov-bitrise support_url: https://community.codecov.io @@ -14,30 +17,262 @@ is_requires_admin_user: false is_always_run: false is_skippable: true inputs: - - CODECOV_TOKEN: + - CC_BINARY: opts: - title: "Codecov.io token" - description: | - Codecov.io repository upload token - is_required: true - is_sensitive: true - - OS: + title: "binary" + description: The file location of a pre-downloaded version of the CLI. If specified, integrity checking will be bypassed. + is_required: false + is_sensitive: false + - CC_BRANCH: opts: - title: "OS Name" - description: | - Name of the OS being used (options are "alpine" | "linux" | "macos") - is_required: true + title: "branch" + description: Branch to which this commit belongs + is_required: false + is_sensitive: false + - CC_BUILD: + opts: + title: "build" + description: Specify the build number manually + is_required: false + is_sensitive: false + - CC_BUILD_URL: + opts: + title: "build_url" + description: The URL of the build where this is running + is_required: false + is_sensitive: false + - CC_CODE: + opts: + title: "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 + is_required: false is_sensitive: false - - VERSION: "latest" + - CC_DIR: opts: - title: "Uploader Version" + title: "dir" + description: Folder to search for coverage files. Default to the current working directory + is_required: false + is_sensitive: false + - CC_DISABLE_FILE_FIXES: "false" + opts: + title: "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 + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_DISABLE_SEARCH: "false" + opts: + title: "disable_search" + description: Disable search for coverage files. This is helpful when specifying what files you want to upload with the files option. + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_DRY_RUN: "false" + opts: + title: "dry_run" + description: Don't upload files to Codecov. + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_ENTERPRISE_URL: + opts: + title: "enterprise_url" + description: Set to the Codecov instance URl. Only applicable to some Enterprise users. + is_required: false + is_sensitive: false + - CC_ENV: + opts: + title: "env" + description: Specify environment variables to be included with this build + is_required: false + is_sensitive: false + - CC_EXCLUDES: + opts: + title: "excludes" + description: Comma-separated list of folders to exclude from search. + is_required: false + is_sensitive: false + - CC_FAIL_ON_ERROR: "false" + opts: + title: "fail_on_error" + description: Exit with non-zero code in case of error. + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_FILES: + opts: + title: "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. + is_required: false + is_sensitive: false + - CC_FLAGS: + opts: + title: "flags" + description: Comma-separated list of flags to upload to group coverage metrics. + is_required: false + is_sensitive: false + - CC_GCOV_ARGS: + opts: + title: "gcov_args" + description: Extra arguments to pass to gcov + is_required: false + is_sensitive: false + - CC_GCOV_EXECUTABLE: + opts: + title: "gcov_executable" + description: gcov executable to run. Defaults to 'gcov' + is_required: false + is_sensitive: false + - CC_GCOV_IGNORE: + opts: + title: "gcov_ignore" + description: Paths to ignore during gcov gathering + is_required: false + is_sensitive: false + - CC_GCOV_INCLUDE: + opts: + title: "gcov_include" + description: "Paths to include during gcov gathering" + is_required: false + is_sensitive: false + - CC_GIT_SERVICE: + opts: + title: "git_service" + description: One of [github|gitlab|bitbucket|github_enterprise|gitlab_enterprise|bitbucket_server] + is_required: false + is_sensitive: false + value_options: + - "bitbucket" + - "bitbucket_enterprise" + - "github" + - "github_enterprise" + - "gitlab" + - "gitlab_enterprise" + - CC_HANDLE_NO_REPORTS_FOUND: "false" + opts: + title: "handle_no_reports_found" + description: Raise no exceptions when no coverage reports are found. + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_JOB_CODE: + opts: + title: "job_code" description: | - Version of the Codecov Uploader to use (e.g. `v0.1.2`) is_required: false is_sensitive: false - - other_options: "-C $GIT_CLONE_COMMIT_HASH" + - CC_LEGACY: "false" + opts: + title: "legacy" + description: Use the legacy upload endpoint. + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_NAME: + opts: + title: "name" + description: Custom defined name of the upload. Visible in Codecov UI + is_required: false + is_sensitive: false + - CC_NETWORK_FILTER: + opts: + title: "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. + is_required: false + is_sensitive: false + - CC_NETWORK_PREFIX: + opts: + title: "network_prefix" + description: Specify a prefix on files listed in the network section of the Codecov report. Useful to help resolve path fixing. + is_required: false + is_sensitive: false + - CC_NETWORK_ROOT_FOLDER: + opts: + title: "network_root_folder" + description: Root folder from which to consider paths on the network section. Defaults to current working directory. + is_required: false + is_sensitive: false + - CC_PARENT_SHA: + opts: + title: "parent_sha" + description: SHA (with 40 chars) of what should be the parent of this commit. + is_required: false + is_sensitive: false + - CC_PLUGINS: + opts: + title: "plugins" + description: Comma-separated list of plugins to run. Specify `noop` to turn off all plugins + is_required: false + is_sensitive: false + - CC_PR: + opts: + title: "pr" + description: Specify the pull request number manually. Used to override pre-existing CI environment variables. + is_required: false + is_sensitive: false + - CC_REPORT_TYPE: + opts: + title: "report_type" + description: The type of file to upload, coverage by default. Possible values are "testing", "coverage". + is_required: false + is_sensitive: false + - CC_SHA: opts: - title: Additional options for Codecov call - description: |- - Options to pass along to the Codecovcli uploader. - You can use multiple options, separated by a space. + title: "sha" + description: Commit SHA (with 40 chars) + is_required: false + is_sensitive: false + - CC_SKIP_VALIDATION: "false" + opts: + title: "skip_validation" + description: Skip integrity checking of the CLI. This is NOT recommended. + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_SLUG: + opts: + title: "slug" + description: Set to the owner/repo slug used instead of the private repo token. Only applicable to some Enterprise users. + is_required: false + is_sensitive: false + - CC_SWIFT_PROJECT: + opts: + title: "swift_project" + description: Specify the swift project name. Useful for optimization. + is_required: false + is_sensitive: false + - CC_TOKEN: + opts: + title: "token" + description: The repository upload token given in Codecov.io + is_required: false + is_sensitive: false + - CC_VERBOSE: "false" + opts: + title: "verbose" + description: Use verbose logging in the CLI + is_required: false + is_sensitive: false + value_options: + - "true" + - "false" + - CC_VERSION: "latest" + opts: + title: "version" + description: Which version of the Codecov CLI to use (defaults to 'latest') + is_required: false + is_sensitive: false