Skip to content

Commit

Permalink
Add coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
anniel-stripe committed Aug 23, 2022
1 parent 3c819a3 commit 940c3e9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ jobs:
- name: Test with pytest
run: make test-gh-actions

coveralls:
name: Coveralls
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Start stripe-mock
run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5

- name: Calculate and publish coverage
run: make coveralls
env:
python-version: "3.10"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
name: Publish
if: >-
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ test-gh-actions: venv
@${VENV_NAME}/bin/tox -p auto $(TOX_ARGS)

coveralls: venv
${VENV_NAME}/bin/python -m pip install -U coveralls
@${VENV_NAME}/bin/tox -e coveralls

fmt: venv
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![pypi](https://img.shields.io/pypi/v/stripe.svg)](https://pypi.python.org/pypi/stripe)
[![Build Status](https://github.com/stripe/stripe-python/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-python/actions?query=branch%3Amaster)

[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-python/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-python?branch=master)

The Stripe Python library provides convenient access to the Stripe API from
applications written in the Python language. It includes a pre-defined set of
Expand All @@ -20,7 +20,6 @@ See the [Python API docs](https://stripe.com/docs/api?lang=python).

See [video demonstrations][youtube-playlist] covering how to use the library.


## Installation

You don't need this source code unless you want to modify the package. If you just
Expand Down
9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ description = upload coverage to coveralls.io
skip_install = true
setenv =
COVERAGE_FILE = {toxworkdir}/.coverage
passenv =
TRAVIS
TRAVIS_*
passenv = GITHUB_*
deps =
coverage >= 4.5.3, < 5 # TODO: upgrade to coverage 5 when we drop support for Python 3.4
coveralls
pytest
pytest-mock
commands =
coverage run --source=stripe -m pytest tests/
coverage combine
coveralls
coveralls --service=github
depends = py{310,39,38,37,36,35,34,27,py3,py2}

0 comments on commit 940c3e9

Please sign in to comment.