-
Notifications
You must be signed in to change notification settings - Fork 12
53 lines (52 loc) · 1.8 KB
/
python-package.yml
File metadata and controls
53 lines (52 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: build
on:
push:
branches: [ master ]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
- uses: dschep/install-poetry-action@v1.3
- name: Poetry Lock
run: poetry lock
- name: Poetry Install
run: poetry install
- name: requirements.txt
run: poetry run pip freeze | awk '/==/' > requirements.txt
- name: requirements-docs.txt
run: poetry run pip freeze | awk '/sphinx|Sphinx|ipython/' > docs/requirements.txt
- name: Black
run: poetry run python -m black .
- name: Dephell Convert
run: poetry run python -m dephell convert
- name: install package locally
run: pip install .
- name: generate api doc
run: sphinx-apidoc -M -T -f -o docs/api simple_back
- name: install pandoc & python3-sphinx
run: sudo apt-get install -y pandoc python3-sphinx python3-nbsphinx python3-pypandoc
- name: generate sphinx doc
run: cd docs && mkdir -p _build/html && touch _build/html/.nojekyll && poetry run make html
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs/_build/html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v4.3.0
with:
commit_message: "build"
branch: ${{ github.head_ref }}
- name: Lint
run: poetry run python -m flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: pylint badge
run: poetry run pylint-badge simple_back
- name: Test
run: poetry run python -m pytest --cov=simple_back --cov-branch --cov-report=xml tests/
- name: Codecov
uses: codecov/codecov-action@v1.0.7