Skip to content

Add Codeclimate and codecov to Github CI/CD #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Send Coverage to different analitic engines
# Only for last versions of python and mongo

on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- "*"

jobs:
coverage:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mongodb-version: [4.2]
include:
- name: "coverage"
python: "3.8"
tox_env: "py38"

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox virtualenv
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Test build
run: "tox -e ${{ matrix.tox_env }} -- --cov-report=xml --cov-report=html"
- name: Send coverage report to codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
- name: Send coverage report to codeclimate
uses: paambaati/[email protected]
with:
coverageCommand: echo "Ignore rerun"
coverageLocations: ${{github.workspace}}/coverage.xml:coverage.py
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
36 changes: 36 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Linting Tests
# Only for last versions of python

on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- "*"

jobs:
linting:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: "linting"
python: "3.8"
tox_env: "lint"

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox virtualenv
- name: Test build
run: "tox -e ${{ matrix.tox_env }}"
13 changes: 1 addition & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,23 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mongodb-version: [3.6, 4.0, 4.2]

include:
- name: "linting"
python: "3.8"
os: ubuntu-latest
tox_env: "lint"
mongodb-version: 4.2

- name: "ubuntu-py36"
python: "3.6"
os: ubuntu-latest
tox_env: "py36"
- name: "ubuntu-py37"
python: "3.7"
os: ubuntu-latest
tox_env: "py37"
- name: "ubuntu-py38"
python: "3.8"
os: ubuntu-latest
tox_env: "py38"
- name: "ubuntu-pypy3"
python: "pypy3"
os: ubuntu-latest
tox_env: "pypy3"

steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ venv/
.eggs
.idea
.vscode
htmlcov/
coverage.xml
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ envlist = {py36,py37,py38,pypy3},lint

[testenv]
commands =
python -m pytest
python -m pytest {posargs}
deps =
PyMongo>3.9.0
pytest
Expand Down