Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/email-writing-context-tdd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Email Writing Context TDD

on:
push:
branches:
- feat/llm-email-writing-context-task4
workflow_dispatch:

permissions:
contents: read

concurrency:
group: email-writing-context-tdd-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
context-service:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
cache: pip
cache-dependency-path: backend/requirements-hashes.txt
- run: python -m pip install --disable-pip-version-check --require-hashes -r backend/requirements-hashes.txt
- name: Install hash-verified coverage tool
run: |
set -euo pipefail
mkdir -p /tmp/coverage-wheel
cat >/tmp/coverage-lock.txt <<'EOF'
coverage==7.15.2 --hash=sha256:eb6bcae8d1a9d305351ecb108232441d11c5cfe9de840a04388ba5d2db8d735c
EOF
python -m pip download \
--disable-pip-version-check \
--require-hashes \
--no-deps \
--only-binary=:all: \
--platform any \
--python-version 3.14 \
--implementation py \
--abi none \
--dest /tmp/coverage-wheel \
-r /tmp/coverage-lock.txt
python -m pip install --disable-pip-version-check --no-deps /tmp/coverage-wheel/coverage-7.15.2-py3-none-any.whl
- name: Run authorized email and thread context tests
run: |
cd backend
python -m pytest -q \
tests/test_email_writing_context_service.py \
tests/test_email_writing_context_service_coverage.py
- name: Verify context service statement and branch coverage
run: |
cd backend
python -m coverage erase
python -m coverage run --branch \
--include='services/email_writing_context_service.py' \
-m pytest -q \
tests/test_email_writing_context_service.py \
tests/test_email_writing_context_service_coverage.py
python -m coverage report --show-missing --fail-under=100 \
services/email_writing_context_service.py
- name: Lint context service and tests
run: |
cd backend
python -m ruff check \
services/email_writing_context_service.py \
tests/test_email_writing_context_service.py \
tests/test_email_writing_context_service_coverage.py
Loading