Merge pull request #14 from jmbannon/test2

Add github workflows for tests
This commit is contained in:
Jesse Bannon 2022-04-29 01:11:21 -07:00 committed by GitHub
commit 47438865af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 6 deletions

View file

@ -1,4 +1,4 @@
name: Pylint
name: ytld-sub build, lint, test
on: [push]
@ -17,7 +17,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
pip install .[lint,test]
- name: Run linters
run: |
./tools/linter check
- name: Run tests with coverage
run: |
./tools/test

View file

@ -1,4 +1,4 @@
# 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

View file

@ -1,6 +1,6 @@
# Run within root directory
if [ $1 = "check" ]; then
if [[ $1 = "check" ]]; then
isort . --check-only --diff \
&& black . --check \
&& pylint src/ \

View file

@ -1,2 +1,8 @@
# Run within root folder. Runs tests with coverage, and reports it to html
coverage run -m pytest && coverage html
# Run within root directory
if [[ $1 = "html" ]]; then
coverage run -m pytest && coverage html
else
coverage run -m pytest && coverage report
fi