Skip to content

Commit 00d73ad

Browse files
authored
Add GitHub Actions CI workflow (#28)
* #24 Add implementation plan for CI workflow * #24 Add ruff to dev dependencies * #24 Add GitHub Actions CI workflow Runs lint (ruff check + format) and tests (pytest with coverage) on pull requests to develop and main branches. * #24 Fix CI workflow: quote version specifiers, add push trigger, align deps - Quote pip install version specifiers to prevent shell glob expansion - Add push trigger for develop and main branches - Align dependency versions with requirements.txt - Add pip cache to lint job * #24 Update plan with implementation deviations
1 parent ee6985b commit 00d73ad

3 files changed

Lines changed: 103 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [develop, main]
6+
pull_request:
7+
branches: [develop, main]
8+
9+
jobs:
10+
lint:
11+
name: Lint & Format
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
cache: pip
20+
21+
- name: Install Ruff
22+
run: pip install 'ruff>=0.9.0'
23+
24+
- name: Ruff check
25+
run: ruff check .
26+
27+
- name: Ruff format check
28+
run: ruff format --check .
29+
30+
test:
31+
name: Test & Coverage
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: actions/setup-python@v5
37+
with:
38+
python-version: "3.12"
39+
cache: pip
40+
41+
- name: Install dependencies
42+
run: |
43+
pip install --upgrade pip
44+
pip install 'fastapi>=0.115.0' 'uvicorn[standard]>=0.34.0' 'python-multipart>=0.0.20' 'python-dotenv>=1.0.0'
45+
pip install 'pytest>=8.0.0' 'pytest-asyncio>=0.24.0' 'httpx>=0.27.0' 'pytest-cov>=6.0.0'
46+
47+
- name: Run tests with coverage
48+
run: pytest --cov --cov-report=term-missing --cov-fail-under=80

docs/plans/24-ci-workflow.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Plan: CI Workflow Setup
2+
3+
**Story**: #24
4+
**Spec**: docs/specs/test-framework-setup.md (US6, US7)
5+
**Branch**: feature/24-ci-workflow
6+
**Date**: 2026-03-14
7+
**Mode**: Standard — infrastructure config, no application code
8+
9+
## Technical Decisions
10+
11+
### TD-1: Dependency installation in CI
12+
- **Context**: requirements.txt includes whisperx (git+https) and torch, which are large and need GPU
13+
- **Decision**: Use a separate `requirements-ci.txt` that excludes ML dependencies, since all tests mock them
14+
- **Alternatives considered**: Filtering requirements.txt with grep — fragile; installing everything — slow and unnecessary
15+
16+
### TD-2: Ruff installation
17+
- **Context**: Ruff is not yet in requirements.txt but pyproject.toml already configures it
18+
- **Decision**: Add ruff to dev dependencies in requirements.txt
19+
- **Alternatives considered**: Install only in CI — would force devs to install separately
20+
21+
## Files to Create or Modify
22+
23+
- `requirements.txt` — add ruff to dev dependencies
24+
- `.github/workflows/ci.yml` — GitHub Actions workflow
25+
26+
## Approach per AC
27+
28+
### AC 1-2: Workflow file and triggers
29+
Create `.github/workflows/ci.yml` triggered on PRs to develop and main
30+
31+
### AC 3-6: CI steps
32+
Checkout, Python 3.12, install deps (excluding ML packages), ruff check, ruff format --check, pytest --cov with fail_under=80
33+
34+
### AC 7: Ruff in dev dependencies
35+
Add ruff to requirements.txt under dev dependencies section
36+
37+
## Commit Sequence
38+
39+
1. Add ruff to dev dependencies
40+
2. Add GitHub Actions CI workflow
41+
42+
## Risks and Trade-offs
43+
44+
- Coverage threshold may not be met with current test suite — pyproject.toml already sets fail_under=80
45+
46+
## Deviations from Spec
47+
48+
- Spec mentions branch protection documentation (US7) — skipping as it's a manual GitHub settings task, not code
49+
50+
## Deviations from Plan
51+
52+
- Added `push` trigger for develop/main in addition to `pull_request` (architect review: direct merges would skip CI)
53+
- Aligned CI dependency versions with requirements.txt instead of using bare package names
54+
- Added pip cache to lint job for consistency with test job

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ pytest>=8.0.0
1111
pytest-asyncio>=0.24.0
1212
httpx>=0.27.0
1313
pytest-cov>=6.0.0
14+
ruff>=0.9.0

0 commit comments

Comments
 (0)