Skip to content

Commit 0003e6d

Browse files
Add travis.yml and update requirements to add coverage
Signed-off-by: Jai <jai@deepsource.io>
1 parent 7126f10 commit 0003e6d

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Set build language to Python
2+
language: python
3+
4+
# Set python version to 3.6
5+
python: 3.6
6+
7+
# Install dependencies
8+
install:
9+
- pip install -r requirements.txt
10+
11+
# Run unit tests
12+
script:
13+
- coverage run test_hello.py
14+
15+
# Report results to DeepSource
16+
after_success:
17+
# Generate coverage report in xml format
18+
- coverage xml
19+
20+
# Install deepsource CLI
21+
- curl https://deepsource.io/cli | sh
22+
23+
# Report coverage artifact to 'test-coverage' analyzer
24+
- ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
1-
# guide-travis-python
2-
Repository for travis,python guide --
1+
<p align="center">
2+
<img src="https://deepsource.io/images/logo-wordmark-dark.svg" />
3+
</p>
4+
5+
<p align="center">
6+
<a href="https://deepsource.io/docs">Documentation</a> |
7+
<a href="https://deepsource.io/signup">Get Started</a> |
8+
<a href="https://gitter.im/deepsourcelabs/lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link">Developer Chat</a>
9+
</p>
10+
11+
<p align="center">
12+
DeepSource helps you ship good code.
13+
</p>
14+
15+
</p>
16+
17+
---
18+
19+
# Guide
20+
21+
## Setting up Continuous Quality with GitHub and Travis CI for Python
22+
23+
Refer [deepsource.io/docs/guides/cq-github-python-travis.html](https://deepsource.io/docs/guides/cq-github-python-travis.html) for the procedure.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pytest
2+
coverage
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import hello
22

3-
43
def test_says_world():
54
assert hello.say_what() == 'world'
5+
6+
if __name__ == "__main__":
7+
test_says_world()

0 commit comments

Comments
 (0)