Files
openworker/.github/workflows/ci.yml
Shakti Prasad Mohapatra f54d62724f fix: add coverage measurement and reporting to CI
The test suite is broad (79 files) but has no coverage measurement or
threshold, so regressions in under-tested paths go unnoticed.

Add pytest-cov to dev dependencies, configure coverage in pyproject.toml
(branch coverage, source=coworker, show_missing), and update CI to run
pytest with --cov and upload the coverage.xml artifact.

The fail_under floor is set to 0 initially so CI passes without changes
to existing coverage. Once a baseline is established, the floor can be
ratcheted up over time.

Fixes #288
2026-09-12 22:50:20 +05:30

67 lines
1.8 KiB
YAML

# App CI — the coworker Python suite, the GUI unit tests, and the hermetic
# Playwright e2e suite (mocked /v1 + WS; no model or network needed).
name: CI
on: [push, pull_request]
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e ".[messaging,dev,bedrock]"
- name: Test with coverage
run: pytest tests -q --cov=coworker --cov-report=term-missing --cov-report=xml
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
retention-days: 30
gui-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: surfaces/gui/package-lock.json
- name: npm ci
working-directory: surfaces/gui
run: npm ci
- name: Typecheck
working-directory: surfaces/gui
run: npx tsc --noEmit
- name: Unit tests
working-directory: surfaces/gui
run: npm test
gui-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: surfaces/gui/package-lock.json
- name: npm ci
working-directory: surfaces/gui
run: npm ci
- name: Install Playwright browsers
working-directory: surfaces/gui
run: npx playwright install --with-deps chromium
- name: e2e
working-directory: surfaces/gui
run: npm run e2e