diff --git a/.github/workflows/linter.yaml b/.github/workflows/build_lint_test.yaml similarity index 77% rename from .github/workflows/linter.yaml rename to .github/workflows/build_lint_test.yaml index 711ab9f5..c0af307e 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/build_lint_test.yaml @@ -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 diff --git a/tools/docs b/tools/docs index b0b6f55d..f87d4bb7 100755 --- a/tools/docs +++ b/tools/docs @@ -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 diff --git a/tools/linter b/tools/linter index 6ddf8bcb..28394065 100755 --- a/tools/linter +++ b/tools/linter @@ -1,6 +1,6 @@ # Run within root directory -if [ $1 = "check" ]; then +if [[ $1 = "check" ]]; then isort . --check-only --diff \ && black . --check \ && pylint src/ \ diff --git a/tools/test b/tools/test index dd8711ae..16915f28 100755 --- a/tools/test +++ b/tools/test @@ -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 +