Skip to content

Commit f03217b

Browse files
committed
Add Github CI/CD coverage stage
1 parent 32ae3c5 commit f03217b

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

.github/workflows/coverage.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Send Coverage to different analitic engines
2+
# Only for last versions of python and mongo
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
tags:
9+
- "*"
10+
pull_request:
11+
branches:
12+
- "*"
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
mongodb-version: [4.2]
20+
include:
21+
- name: "coverage"
22+
python: "3.8"
23+
os: ubuntu-latest
24+
tox_env: "py38"
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set up Python ${{ matrix.python }}
29+
uses: actions/setup-python@v1
30+
with:
31+
python-version: ${{ matrix.python }}
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install tox virtualenv
36+
- name: Start MongoDB
37+
uses: supercharge/[email protected]
38+
with:
39+
mongodb-version: ${{ matrix.mongodb-version }}
40+
- name: Test build
41+
run: "tox -e ${{ matrix.tox_env }} -- --cov-report=xml --cov-report=html"
42+
- name: Send coverage report to codecov
43+
uses: codecov/codecov-action@v1
44+
with:
45+
file: ./coverage.xml
46+
- name: Send coverage report to codeclimate
47+
uses: paambaati/[email protected]
48+
with:
49+
coverageCommand: echo "Ignore rerun"
50+
coverageLocations: ${{github.workspace}}/coverage.xml:coverage.py
51+
env:
52+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ venv/
1717
.eggs
1818
.idea
1919
.vscode
20+
htmlcov/
21+
coverage.xml

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ envlist = {py36,py37,py38,pypy3},lint
33

44
[testenv]
55
commands =
6-
python -m pytest
6+
python -m pytest {posargs}
77
deps =
88
PyMongo>3.9.0
99
pytest

0 commit comments

Comments
 (0)