Skip to content

Commit 392eda8

Browse files
committed
Add GitHub Actions CI/CD workflow and badges
- Add tests.yml workflow for automated testing - Run unit tests on Python 3.12 and 3.13 - Check code formatting with Black - Run integration tests on main branch (with API key secret) - Upload coverage to Codecov - Add badges to README (tests, python version, license, code style) - Add CI/CD and Contributing sections to README
1 parent 3d4b12d commit 392eda8

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

.github/workflows/tests.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.12", "3.13"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e ".[dev]"
29+
30+
- name: Run unit tests with coverage
31+
run: |
32+
pytest tests/ --cov=speechmatics_vcon_link --cov-report=xml --cov-report=term-missing -v
33+
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v4
36+
with:
37+
token: ${{ secrets.CODECOV_TOKEN }}
38+
files: ./coverage.xml
39+
flags: unittests
40+
name: codecov-umbrella
41+
fail_ci_if_error: false
42+
43+
lint:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: "3.12"
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install black
57+
58+
- name: Check code formatting with Black
59+
run: |
60+
black --check speechmatics_vcon_link/ tests/
61+
62+
integration:
63+
runs-on: ubuntu-latest
64+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
65+
needs: test
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Set up Python
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: "3.12"
73+
74+
- name: Install dependencies
75+
run: |
76+
python -m pip install --upgrade pip
77+
pip install -e ".[dev]"
78+
79+
- name: Run integration tests
80+
if: env.SPEECHMATICS_API_KEY != ''
81+
env:
82+
SPEECHMATICS_API_KEY: ${{ secrets.SPEECHMATICS_API_KEY }}
83+
run: |
84+
pytest tests/test_integration.py --run-integration -v
85+

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Speechmatics vCon Link
22

3+
[![Tests](https://github.com/vcon-dev/speechmatics-link/actions/workflows/tests.yml/badge.svg)](https://github.com/vcon-dev/speechmatics-link/actions/workflows/tests.yml)
4+
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
7+
38
A vCon server link for transcribing audio dialogs using the [Speechmatics](https://www.speechmatics.com/) API. This link processes vCon objects and stores transcription results in both Speechmatics native format and the standardized [World Transcription Format (WTF)](https://datatracker.ietf.org/doc/draft-howe-vcon-wtf-extension/).
49

510
## Features
@@ -305,6 +310,33 @@ speechmatics-link/
305310
- Check module name in config matches: `speechmatics_vcon_link`
306311
- Restart vcon-server after installation
307312
313+
## CI/CD
314+
315+
This project uses GitHub Actions for continuous integration:
316+
317+
- **Unit Tests**: Run on every push and PR (Python 3.12 and 3.13)
318+
- **Code Formatting**: Checked with Black
319+
- **Integration Tests**: Run on main branch pushes (requires `SPEECHMATICS_API_KEY` secret)
320+
- **Coverage**: Uploaded to Codecov
321+
322+
### Setting Up Secrets
323+
324+
For integration tests to run in CI, add the following secrets to your GitHub repository:
325+
326+
1. `SPEECHMATICS_API_KEY` - Your Speechmatics API key
327+
2. `CODECOV_TOKEN` - (Optional) Codecov token for coverage reports
328+
329+
## Contributing
330+
331+
1. Fork the repository
332+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
333+
3. Make your changes
334+
4. Run tests (`pytest tests/ -v`)
335+
5. Format code (`black speechmatics_vcon_link/ tests/`)
336+
6. Commit your changes (`git commit -m 'Add amazing feature'`)
337+
7. Push to the branch (`git push origin feature/amazing-feature`)
338+
8. Open a Pull Request
339+
308340
## License
309341
310342
MIT License - see [LICENSE](LICENSE) for details.

0 commit comments

Comments
 (0)