Skip to content

Commit f87494c

Browse files
Create pipeline Build example-python
1 parent d9d3970 commit f87494c

1 file changed

Lines changed: 89 additions & 0 deletions

File tree

  • .harness/orgs/codecov/projects/codecov/pipelines
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
pipeline:
2+
name: Build example-python
3+
identifier: Build_codecov_example_python_1782243281624
4+
projectIdentifier: codecov
5+
orgIdentifier: codecov
6+
stages:
7+
- stage:
8+
name: Build
9+
identifier: Build
10+
type: CI
11+
spec:
12+
cloneCodebase: true
13+
execution:
14+
steps:
15+
- step:
16+
type: Run
17+
name: Install dependencies
18+
identifier: Install_dependencies
19+
spec:
20+
shell: Sh
21+
command: |-
22+
python -m pip install --upgrade pip
23+
pip install -r requirements.txt
24+
curl -Os https://cli.codecov.io/latest/linux/codecovcli
25+
chmod +x codecovcli
26+
- step:
27+
type: Run
28+
name: Run tests and collect coverage
29+
identifier: Run_tests_and_collect_coverage
30+
spec:
31+
shell: Sh
32+
command: pytest --cov app --junitxml=junit.xml -o junit_family=legacy
33+
reports:
34+
type: JUnit
35+
spec:
36+
paths:
37+
- junit.xml
38+
- step:
39+
type: Run
40+
name: Upload test results to Codecov
41+
identifier: Upload_test_results_to_Codecov
42+
spec:
43+
shell: Sh
44+
command: ./codecovcli do-upload --report-type test_results -f junit.xml --fail-on-error -v
45+
envVariables:
46+
CODECOV_TOKEN: <+secrets.getValue("CODECOV_TOKEN")>
47+
- step:
48+
type: Run
49+
name: Upload coverage to Codecov -- arg token
50+
identifier: Upload_coverage_to_Codecov_arg_token
51+
spec:
52+
shell: Sh
53+
command: ./codecovcli do-upload -t ${CODECOV_TOKEN} --fail-on-error -v
54+
envVariables:
55+
CODECOV_TOKEN: <+secrets.getValue("CODECOV_TOKEN")>
56+
- step:
57+
type: Run
58+
name: Upload coverage to Codecov -- env token
59+
identifier: Upload_coverage_to_Codecov_env_token
60+
spec:
61+
shell: Sh
62+
command: ./codecovcli do-upload --fail-on-error -v
63+
envVariables:
64+
CODECOV_TOKEN: <+secrets.getValue("CODECOV_TOKEN")>
65+
- step:
66+
type: Run
67+
name: Upload coverage to Codecov -- no token
68+
identifier: Upload_coverage_to_Codecov_no_token
69+
spec:
70+
shell: Sh
71+
command: ./codecovcli do-upload --fail-on-error -v
72+
platform:
73+
os: Linux
74+
arch: Amd64
75+
runtime:
76+
type: Cloud
77+
spec: {}
78+
failureStrategies:
79+
- onFailure:
80+
errors:
81+
- AllErrors
82+
action:
83+
type: MarkAsFailure
84+
properties:
85+
ci:
86+
codebase:
87+
connectorRef: account.Github
88+
repoName: codecov/example-python
89+
build: <+input>

0 commit comments

Comments
 (0)