Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(CI): Add codecov for test coverage #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python --version ${{ matrix.python-version }}
- name: Set up Python version ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -27,6 +27,8 @@ jobs:
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
- name: Run tests
- name: Run tests with coverage
run: |
poetry run pytest -vvv test/
poetry run pytest -vvv --cov=dirstory test/
- name: Upload coverage to Codecov
uses: codecov/[email protected]
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ build-image:


test-in-container: build-image
$(CONTAINER_ENGINE) run --rm -it $(CONTAINER_TEST_NAME) /bin/sh -c "poetry run pytest -vvv test/"
$(CONTAINER_ENGINE) run --rm -it $(CONTAINER_TEST_NAME) \
/bin/sh -c "poetry run pytest -vvv --cov=dirstory test/"
75 changes: 74 additions & 1 deletion poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ click = "~=8.1.3"
[tool.poetry.dev-dependencies]
pytest = "~=7.1.2"
flexmock = "~=0.11.3"
pytest-cov = "~=3.0.0"

[tool.poetry.scripts]
dirstory = "dirstory.cli.cli:cli"
Expand Down