44name : Python package
55
66on : [push, pull_request]
7- # push:
8- # branches: [ master ]
9- # pull_request:
10- # branches: [ master ]
117
128jobs :
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 :
0 commit comments