Skip to content
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
51 changes: 32 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@
name: Python package

on: [push, pull_request]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]

jobs:
build:

pre-commit:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[code_style]
- name: Run pre-commit
run: |
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

tests:

runs-on: ubuntu-latest
strategy:
Expand All @@ -26,25 +41,23 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[code_style,testing]
- name: Pre-commit checks
pip install .[testing]
- name: Run pytest
run: |
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
- name: Test with pytest
run: |
pip install pytest
pytest --cov=markdown_it --cov-report=
- name: Upload to coveralls
run: |
pip install coveralls
coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_KEY }}
pytest --cov=markdown_it --cov-report=xml --cov-report=term-missing
- name: Upload to Codecov
if: matrix.python-version == 3.7 && github.repository == 'ExecutableBookProject/markdown-it-py'
uses: codecov/codecov-action@v1
with:
name: markdown-it-py-pytests-py3.7
flags: pytests
file: ./coverage.xml
fail_ci_if_error: true

publish:

name: Publish to PyPi
needs: build
needs: [pre-commit, tests]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# markdown-it-py

[![Github-DI][github-ci]][github-link]
[![Coverage Status][cov-badge]][cov-link]
[![Coverage Status][codecov-badge]][codecov-link]
[![PyPI][pypi-badge]][pypi-link]
[![Conda][conda-badge]][conda-link]
[![Code style: black][black-badge]][black-link]
Expand Down Expand Up @@ -191,8 +191,8 @@ CommonMark spec and reference implementations.
[pypi-link]: https://pypi.org/project/markdown-it-py
[conda-badge]: https://anaconda.org/conda-forge/markdown-it-py/badges/version.svg
[conda-link]: https://anaconda.org/conda-forge/markdown-it-py
[cov-badge]: https://coveralls.io/repos/github/ExecutableBookProject/markdown-it-py/badge.svg?branch=master
[cov-link]: https://coveralls.io/github/ExecutableBookProject/markdown-it-py?branch=master
[codecov-badge]: https://codecov.io/gh/ExecutableBookProject/markdown-it-py/branch/master/graph/badge.svg
[codecov-link]: https://codecov.io/gh/ExecutableBookProject/markdown-it-py
[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg
[black-link]: https://github.com/ambv/black

Expand Down