Skip to content

Commit fa10a25

Browse files
authored
Move to codecov (#9)
1 parent 2a01f4e commit fa10a25

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

.github/workflows/tests.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,28 @@
44
name: Python package
55

66
on: [push, pull_request]
7-
# push:
8-
# branches: [ master ]
9-
# pull_request:
10-
# branches: [ master ]
117

128
jobs:
13-
build:
9+
10+
pre-commit:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python 3.7
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.7
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -e .[code_style]
24+
- name: Run pre-commit
25+
run: |
26+
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
27+
28+
tests:
1429

1530
runs-on: ubuntu-latest
1631
strategy:
@@ -26,25 +41,23 @@ jobs:
2641
- name: Install dependencies
2742
run: |
2843
python -m pip install --upgrade pip
29-
pip install .[code_style,testing]
30-
- name: Pre-commit checks
44+
pip install .[testing]
45+
- name: Run pytest
3146
run: |
32-
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
33-
- name: Test with pytest
34-
run: |
35-
pip install pytest
36-
pytest --cov=markdown_it --cov-report=
37-
- name: Upload to coveralls
38-
run: |
39-
pip install coveralls
40-
coveralls
41-
env:
42-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_KEY }}
47+
pytest --cov=markdown_it --cov-report=xml --cov-report=term-missing
48+
- name: Upload to Codecov
49+
if: matrix.python-version == 3.7 && github.repository == 'ExecutableBookProject/markdown-it-py'
50+
uses: codecov/codecov-action@v1
51+
with:
52+
name: markdown-it-py-pytests-py3.7
53+
flags: pytests
54+
file: ./coverage.xml
55+
fail_ci_if_error: true
4356

4457
publish:
4558

4659
name: Publish to PyPi
47-
needs: build
60+
needs: [pre-commit, tests]
4861
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
4962
runs-on: ubuntu-latest
5063
steps:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# markdown-it-py
22

33
[![Github-DI][github-ci]][github-link]
4-
[![Coverage Status][cov-badge]][cov-link]
4+
[![Coverage Status][codecov-badge]][codecov-link]
55
[![PyPI][pypi-badge]][pypi-link]
66
[![Conda][conda-badge]][conda-link]
77
[![Code style: black][black-badge]][black-link]
@@ -191,8 +191,8 @@ CommonMark spec and reference implementations.
191191
[pypi-link]: https://pypi.org/project/markdown-it-py
192192
[conda-badge]: https://anaconda.org/conda-forge/markdown-it-py/badges/version.svg
193193
[conda-link]: https://anaconda.org/conda-forge/markdown-it-py
194-
[cov-badge]: https://coveralls.io/repos/github/ExecutableBookProject/markdown-it-py/badge.svg?branch=master
195-
[cov-link]: https://coveralls.io/github/ExecutableBookProject/markdown-it-py?branch=master
194+
[codecov-badge]: https://codecov.io/gh/ExecutableBookProject/markdown-it-py/branch/master/graph/badge.svg
195+
[codecov-link]: https://codecov.io/gh/ExecutableBookProject/markdown-it-py
196196
[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg
197197
[black-link]: https://github.com/ambv/black
198198

0 commit comments

Comments
 (0)