Skip to content

Commit

Permalink
feat: add unit test code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
siavashyj committed Jun 22, 2024
1 parent 0c167ba commit f228407
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/test-and-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test and Coverage

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run tests with pytest and generate coverage report
run: |
poetry run pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions youtube-playlist-downloader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
This Python script allows you to download information about playlists created by a YouTube account, including both private and public playlists.
This is useful for backing up your playlists or for analyzing the videos in your playlists.

[![codecov](https://codecov.io/gh/siavashyj/toolbox/branch/main/graph/badge.svg)](https://codecov.io/gh/siavashyj/toolbox)

## Features

- Authenticates with the YouTube API using OAuth 2.0
Expand Down
87 changes: 86 additions & 1 deletion youtube-playlist-downloader/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions youtube-playlist-downloader/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ black = "^23.3.0"
isort = "^5.12.0"
flake8 = "^6.0.0"

[tool.poetry.group.dev.dependencies]
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Expand Down

0 comments on commit f228407

Please sign in to comment.