1+ pipeline :
2+ id : calvin_gh_example_python
3+ name : calvin-gh-example-python
4+ description : Build, test and upload coverage for the example-python repository on a branch
5+ tags :
6+ ai_generated : " "
7+ inputs :
8+ branch :
9+ type : string
10+ required : true
11+ description : Branch to check out
12+ clone :
13+ enabled : true
14+ connector : gh_calvin
15+ ref :
16+ type : branch
17+ name : ${{ inputs.branch }}
18+ stages :
19+ - id : pythonPipBuildTestHostedLinuxStage_1
20+ name : Python pip Build and Test on Harness Cloud (Linux)
21+ clone :
22+ enabled : true
23+ cache :
24+ enabled : true
25+ paths :
26+ - .harness-cache/pip
27+ key : ' <+pipeline.identifier>-python-pip-{{ checksum "requirements.txt" }}'
28+ policy : pull-push
29+ steps :
30+ - id : setupPython
31+ name : Setup Python
32+ template :
33+ uses : setupPython@1.0.0
34+
35+ - id : installDependenciesLinux
36+ name : Install Dependencies on Linux
37+ run :
38+ shell : bash
39+ script : |-
40+ export PIP_CACHE_DIR="$PWD/.harness-cache/pip"
41+ mkdir -p "$PIP_CACHE_DIR"
42+ python3 -m pip install --upgrade pip
43+ if [ -f requirements.txt ]; then
44+ python3 -m pip install -r requirements.txt
45+ fi
46+ python3 -m pip install pytest-cov
47+
48+ - id : testLinux
49+ name : Test on Linux
50+ run-test :
51+ shell : bash
52+ script : |-
53+ mkdir -p reports
54+ python3 -m pytest \
55+ --junitxml=reports/pytest.xml \
56+ --cov=. \
57+ --cov-report=lcov:reports/lcov.info
58+ intelligence :
59+ disabled : true
60+
61+ - id : pullLatestHcli
62+ name : Pull Latest HCLI v28
63+ run :
64+ shell : bash
65+ script : |-
66+ curl -fsSL -o "$HOME/hcli" \
67+ https://app.harness.io/storage/harness-download/harness-ti/hcli/v0.28/hcli-linux-amd64
68+ chmod +x "$HOME/hcli"
69+ "$HOME/hcli" --version
70+ - id : coverage
71+ name : Upload Coverage
72+ run :
73+ shell : bash
74+ script : |-
75+ test -s reports/lcov.info
76+ "$HOME/hcli" cov upload --file=reports/lcov.info --owner=codecov --identifier=example-python
77+ env :
78+ CI_ENABLE_HCLI_FOR_TESTS : " true"
0 commit comments