Merge pull request #14 from jmbannon/test2
Add github workflows for tests
This commit is contained in:
commit
47438865af
4 changed files with 15 additions and 6 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: Pylint
|
name: ytld-sub build, lint, test
|
||||||
|
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
|
|
@ -17,7 +17,10 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install .[lint]
|
pip install .[lint,test]
|
||||||
- name: Run linters
|
- name: Run linters
|
||||||
run: |
|
run: |
|
||||||
./tools/linter check
|
./tools/linter check
|
||||||
|
- name: Run tests with coverage
|
||||||
|
run: |
|
||||||
|
./tools/test
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Uncomment to build api docs
|
# Uncomment to build api docs
|
||||||
# sphinx-apidoc -f -o docs/source ytdl_subscribea
|
# sphinx-apidoc -f -o docs/source src/ytdl_sub
|
||||||
sphinx-build -a -b html docs docs/_html
|
sphinx-build -a -b html docs docs/_html
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Run within root directory
|
# Run within root directory
|
||||||
|
|
||||||
if [ $1 = "check" ]; then
|
if [[ $1 = "check" ]]; then
|
||||||
isort . --check-only --diff \
|
isort . --check-only --diff \
|
||||||
&& black . --check \
|
&& black . --check \
|
||||||
&& pylint src/ \
|
&& pylint src/ \
|
||||||
|
|
|
||||||
10
tools/test
10
tools/test
|
|
@ -1,2 +1,8 @@
|
||||||
# Run within root folder. Runs tests with coverage, and reports it to html
|
# Run within root directory
|
||||||
coverage run -m pytest && coverage html
|
|
||||||
|
if [[ $1 = "html" ]]; then
|
||||||
|
coverage run -m pytest && coverage html
|
||||||
|
else
|
||||||
|
coverage run -m pytest && coverage report
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue