forked from turecekt/vs_project
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.52 KB
/
Copy pathpython_checker.yml
File metadata and controls
71 lines (60 loc) · 1.52 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Python checker
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 flake8-docstrings pytest pytest-cov pdoc
if [ -f requirements.txt ]
then
pip install -r requirements.txt
fi
- name: Test with pytest
run: |
pytest --doctest-modules --cov=. --cov-fail-under=66
- name: Lint with flake8
run: |
flake8 .
- name: Text documentation with pydoc
run: |
if [ -f __init__.py ]
then
dir=$(basename `pwd`)
cd ../
pydoc3 $dir
cd $dir
else
pydoc3 ./*.py `ls --hide=*.py --hide=*.md --hide=*.txt --hide=__pycache__`
fi
- name: HTML documentation with pdoc
run: |
if [ -f __init__.py ]
then
pdoc -o docs/ `pwd`
else
pdoc -o docs/ `ls --hide=*.md --hide=*.txt --hide=__pycache__`
fi
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: docs/
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v1