Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

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

Rajat Gupta57ecfca8626a
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index c40f56e86..c357e514b 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -37,4 +37,4 @@ jobs:
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
- uses: pypa/gh-action-pypi-publish@release/v1
+ uses: pypa/gh-action-pypi-publish@release/v1
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c9e280f57..faa1bd1b0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,3 +26,12 @@ jobs:
run: make ci_lint
- name: Test with pytest
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 }}
+
diff --git a/Makefile b/Makefile
index 932cfbc7c..a83d57e85 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ PIP := $(PYTHON) -m pip
PROJECT_NAME := embedchain
# Targets
-.PHONY: install format lint clean test ci_lint ci_test
+.PHONY: install format lint clean test ci_lint ci_test coverage
install:
poetry install
@@ -39,3 +39,6 @@ ci_lint:
ci_test:
poetry run pytest
+
+coverage:
+ poetry run pytest --cov=$(PROJECT_NAME) --cov-report=xml
diff --git a/pyproject.toml b/pyproject.toml
index af113c4c7..189fff784 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -118,6 +118,7 @@ pytest-mock = "^3.10.0"
pytest-env = "^0.8.1"
click = "^8.1.3"
isort = "^5.12.0"
+pytest-cov = "^4.1.0"
[tool.poetry.extras]
streamlit = ["streamlit"]