Skip to content

Commit 8c7752f

Browse files
committed
github: add coverage support
1 parent 77fb633 commit 8c7752f

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

.github/workflows/coverage.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: coverage
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- "**"
11+
paths-ignore:
12+
- "docs/**"
13+
14+
jobs:
15+
coverage:
16+
name: "Coverage"
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repo
20+
uses: actions/checkout@v4
21+
- name: Set up Python
22+
id: setup_python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.10"
26+
- name: Cache virtual environment
27+
uses: actions/cache@v3
28+
with:
29+
# We are hashing dev-requirements.txt and test-requirements.txt which
30+
# contain all dependencies needed to run the tests.
31+
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('dev-requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}
32+
path: .venv
33+
- name: Install system packages
34+
id: install_system_packages
35+
run: |
36+
sudo apt-get install -y portaudio19-dev
37+
- name: Setup virtual environment
38+
run: |
39+
python -m venv .venv
40+
- name: Install basic Python dependencies
41+
run: |
42+
source .venv/bin/activate
43+
python -m pip install --upgrade pip
44+
pip install -r dev-requirements.txt -r test-requirements.txt
45+
- name: Run tests with coverage
46+
run: |
47+
source .venv/bin/activate
48+
coverage run
49+
coverage xml
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v5
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
slug: pipecat-ai/pipecat

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
 <img alt="pipecat" width="300px" height="auto" src="https://raw.githubusercontent.com/pipecat-ai/pipecat/main/pipecat.png">
33
</div></h1>
44

5-
[![PyPI](https://img.shields.io/pypi/v/pipecat-ai)](https://pypi.org/project/pipecat-ai) ![Tests](https://github.com/pipecat-ai/pipecat/actions/workflows/tests.yaml/badge.svg) [![Docs](https://img.shields.io/badge/Documentation-blue)](https://docs.pipecat.ai) [![Discord](https://img.shields.io/discord/1239284677165056021)](https://discord.gg/pipecat)
5+
[![PyPI](https://img.shields.io/pypi/v/pipecat-ai)](https://pypi.org/project/pipecat-ai) ![Tests](https://github.com/pipecat-ai/pipecat/actions/workflows/tests.yaml/badge.svg) [![codecov](https://codecov.io/gh/pipecat-ai/pipecat/graph/badge.svg?token=LNVUIVO4Y9)](https://codecov.io/gh/pipecat-ai/pipecat) [![Docs](https://img.shields.io/badge/Documentation-blue)](https://docs.pipecat.ai) [![Discord](https://img.shields.io/discord/1239284677165056021)](https://discord.gg/pipecat)
66

77
Pipecat is an open source Python framework for building voice and multimodal conversational agents. It handles the complex orchestration of AI services, network transport, audio processing, and multimodal interactions, letting you focus on creating engaging experiences.
88

dev-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build~=1.2.2
2+
coverage~=7.6.12
23
grpcio-tools~=1.67.1
34
pip-tools~=7.4.1
45
pre-commit~=4.0.1

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,8 @@ select = [
112112

113113
[tool.ruff.lint.pydocstyle]
114114
convention = "google"
115+
116+
[tool.coverage.run]
117+
command_line = "--module pytest"
118+
source = ["src"]
119+
omit = ["*/tests/*"]

0 commit comments

Comments
 (0)