From b42d4722524dae298ffb836fdfe8562e527f804e Mon Sep 17 00:00:00 2001 From: Bruno Paulin Date: Tue, 9 Jun 2020 21:26:35 +0200 Subject: [PATCH] CI --- .github/workflows/{ci.yml => build.yml} | 15 +++++++++++---- README.md | 7 ++++--- setup.cfg | 6 ++++++ 3 files changed, 21 insertions(+), 7 deletions(-) rename .github/workflows/{ci.yml => build.yml} (80%) diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 80% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 5fdc471..cdcaba7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,12 @@ # This workflows will upload a Python Package using Twine when a release is created # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries -name: CI/CD +name: build on: push jobs: - deploy: - + build: runs-on: ubuntu-latest steps: @@ -26,10 +25,18 @@ jobs: - name: Test and build run: | pip install -e . - pytest + pytest --cov-report=xml black --check . python setup.py sdist bdist_wheel + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.7 + if: github.ref == 'refs/heads/master' + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + flags: unittests + - name: Publish on test.pypi env: TWINE_USERNAME: __token__ diff --git a/README.md b/README.md index 29adc10..7d8655d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ brownpaperbag ============= -[![PyPI - version](https://img.shields.io/pypi/v/brownpaperbag.svg)](https://pypi.python.org/pypi/brownpaperbag) ![GitHub](https://img.shields.io/github/license/bpaulin/brownpaperbag.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/brownpaperbag.svg) - -[![Build](https://img.shields.io/travis/bpaulin/brownpaperbag.svg)](https://travis-ci.org/bpaulin/brownpaperbag) [![Updates](https://pyup.io/repos/github/bpaulin/brownpaperbag/shield.svg)](https://pyup.io/repos/github/bpaulin/brownpaperbag/) +[![PyPI - version](https://img.shields.io/pypi/v/brownpaperbag.svg)](https://pypi.python.org/pypi/brownpaperbag) +![](https://github.com/bpaulin/brownpaperbag/workflows/build/badge.svg) +[![CodeFactor](https://www.codefactor.io/repository/github/bpaulin/brownpaperbag/badge)](https://www.codefactor.io/repository/github/bpaulin/brownpaperbag) +[![codecov](https://codecov.io/gh/bpaulin/brownpaperbag/branch/master/graph/badge.svg)](https://codecov.io/gh/bpaulin/brownpaperbag) > But you try and tell the young people today that... diff --git a/setup.cfg b/setup.cfg index 4e2d992..421eb68 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,3 +10,9 @@ replace = {new_version} [bumpversion:file:brownpaperbag/__init__.py] search = __version__ = '{current_version}' replace = {new_version} + +[run] +omit = tests/* + +[tool:pytest] +addopts = --cov --cov-config=setup.cfg