Setup codecov.io to measure test coverage #696 (#739)

This commit is contained in:
Rajat Gupta
2023-09-30 23:56:49 +05:30
committed by GitHub
parent 28d41e9397
commit 57ecfca862
4 changed files with 15 additions and 2 deletions

View File

@@ -37,4 +37,4 @@ jobs:
- name: Publish distribution 📦 to PyPI - name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags') if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1 uses: pypa/gh-action-pypi-publish@release/v1

View File

@@ -26,3 +26,12 @@ jobs:
run: make ci_lint run: make ci_lint
- name: Test with pytest - name: Test with pytest
run: make ci_test run: make ci_test
- name: Generate coverage report
run: make coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
file: coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -4,7 +4,7 @@ PIP := $(PYTHON) -m pip
PROJECT_NAME := embedchain PROJECT_NAME := embedchain
# Targets # Targets
.PHONY: install format lint clean test ci_lint ci_test .PHONY: install format lint clean test ci_lint ci_test coverage
install: install:
poetry install poetry install
@@ -39,3 +39,6 @@ ci_lint:
ci_test: ci_test:
poetry run pytest poetry run pytest
coverage:
poetry run pytest --cov=$(PROJECT_NAME) --cov-report=xml

View File

@@ -118,6 +118,7 @@ pytest-mock = "^3.10.0"
pytest-env = "^0.8.1" pytest-env = "^0.8.1"
click = "^8.1.3" click = "^8.1.3"
isort = "^5.12.0" isort = "^5.12.0"
pytest-cov = "^4.1.0"
[tool.poetry.extras] [tool.poetry.extras]
streamlit = ["streamlit"] streamlit = ["streamlit"]