diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..eca4871c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -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/mongodb-github-action@1.3.0 + 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/codeclimate-action@v2.6.0 + with: + coverageCommand: echo "Ignore rerun" + coverageLocations: ${{github.workspace}}/coverage.xml:coverage.py + env: + CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 00000000..66c35948 --- /dev/null +++ b/.github/workflows/linting.yml @@ -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 }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae903ebc..43d9800f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: diff --git a/.gitignore b/.gitignore index 680ad123..f1f17873 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ venv/ .eggs .idea .vscode +htmlcov/ +coverage.xml diff --git a/tox.ini b/tox.ini index 918f6763..6a3a3327 100644 --- a/tox.ini +++ b/tox.ini @@ -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