Skip to content

Commit 8451eb2

Browse files
authored
Merge: Add Codeclimate and codecov to Github CI/CD
Add Codeclimate and codecov to Github CI/CD
2 parents af4b255 + 3529c80 commit 8451eb2

File tree

5 files changed

+92
-13
lines changed

5 files changed

+92
-13
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+
coverage:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
mongodb-version: [4.2]
21+
include:
22+
- name: "coverage"
23+
python: "3.8"
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}}

.github/workflows/linting.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Linting Tests
2+
# Only for last versions of python
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
tags:
9+
- "*"
10+
pull_request:
11+
branches:
12+
- "*"
13+
14+
jobs:
15+
linting:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- name: "linting"
22+
python: "3.8"
23+
tox_env: "lint"
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Set up Python ${{ matrix.python }}
28+
uses: actions/setup-python@v1
29+
with:
30+
python-version: ${{ matrix.python }}
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install tox virtualenv
35+
- name: Test build
36+
run: "tox -e ${{ matrix.tox_env }}"

.github/workflows/main.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,23 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ${{ matrix.os }}
15+
runs-on: ubuntu-latest
1616
strategy:
1717
fail-fast: false
1818
matrix:
1919
mongodb-version: [3.6, 4.0, 4.2]
20-
2120
include:
22-
- name: "linting"
23-
python: "3.8"
24-
os: ubuntu-latest
25-
tox_env: "lint"
26-
mongodb-version: 4.2
27-
2821
- name: "ubuntu-py36"
2922
python: "3.6"
30-
os: ubuntu-latest
3123
tox_env: "py36"
3224
- name: "ubuntu-py37"
3325
python: "3.7"
34-
os: ubuntu-latest
3526
tox_env: "py37"
3627
- name: "ubuntu-py38"
3728
python: "3.8"
38-
os: ubuntu-latest
3929
tox_env: "py38"
4030
- name: "ubuntu-pypy3"
4131
python: "pypy3"
42-
os: ubuntu-latest
4332
tox_env: "pypy3"
4433

4534
steps:

.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)