diff --git a/.harness/orgs/codecov/projects/codecov/pipelines/CI.yaml b/.harness/orgs/codecov/projects/codecov/pipelines/CI.yaml new file mode 100644 index 00000000..ff83b086 --- /dev/null +++ b/.harness/orgs/codecov/projects/codecov/pipelines/CI.yaml @@ -0,0 +1,76 @@ +pipeline: + name: Build example-python + identifier: Build_codecov_example_python_1782243281624 + projectIdentifier: codecov + orgIdentifier: codecov + stages: + - stage: + name: Build + identifier: Build + type: CI + spec: + cloneCodebase: true + execution: + steps: + - step: + type: Run + name: Install dependencies + identifier: Install_dependencies + spec: + shell: Sh + command: |- + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install codecov-cli + - step: + type: Run + name: Run tests and collect coverage + identifier: Run_tests_and_collect_coverage + spec: + shell: Sh + command: pytest --cov app --cov-report=lcov:lcov.info + - step: + type: Run + name: Upload coverage to Harness + identifier: Upload_coverage_to_Harness + spec: + shell: Sh + command: hcli cov upload --file=lcov.info + envVariables: + CI_ENABLE_HCLI_FOR_TESTS: "true" + - step: + type: Run + name: Upload coverage to Codecov -- arg token + identifier: Upload_coverage_to_Codecov_arg_token + spec: + shell: Sh + command: codecovcli --verbose do-upload -t ${CODECOV_TOKEN} --fail-on-error + envVariables: + CODECOV_TOKEN: <+secrets.getValue("CODECOV_TOKEN")> + - step: + type: Run + name: Upload coverage to Codecov -- env token + identifier: Upload_coverage_to_Codecov_env_token + spec: + shell: Sh + command: codecovcli --verbose do-upload --fail-on-error + envVariables: + CODECOV_TOKEN: <+secrets.getValue("CODECOV_TOKEN")> + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: MarkAsFailure + properties: + ci: + codebase: + connectorRef: codecov + repoName: example-python + build: <+input>