43bbbb6bbb
New suites assert real behavior, not just that code runs: - test_types: workout serialization round-trips (recursive steps, camelCase keys, enum conversion) + __str__ formatting. - test_api_client: request construction (URL/method/auth/body) and the full HTTP status-code -> message mapping. - test_auth: RS256 JWT verification — valid -> AccessToken; expired/wrong-aud/ wrong-issuer/wrong-key/missing-claim -> None; audience slash variants. - test_server_setup: transport selection + start_server dispatch. - test_events / test_activities / test_custom_items: request payloads (create vs update, POST/PUT/DELETE), delete accounting, JSON-content parsing, and error/empty branches. Enforce >=90 via pytest --cov-fail-under=90; CI test job now gates the build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61 lines
1.3 KiB
YAML
61 lines
1.3 KiB
YAML
name: build-image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
env:
|
|
API_KEY: test
|
|
ATHLETE_ID: i1
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
- name: Install (with dev extras)
|
|
run: pip install --quiet ".[dev]"
|
|
- name: Test + coverage gate (>=90%)
|
|
run: pytest
|
|
|
|
build:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
env:
|
|
IMAGE: git.farh.net/farhoodlabs/intervalsicu-mcp
|
|
DOCKER_BUILDKIT: "1"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Environment
|
|
run: |
|
|
docker version || true
|
|
df -h / || true
|
|
|
|
- name: Login to registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.farh.net -u cpfarhood --password-stdin
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build --progress=plain \
|
|
-t "${IMAGE}:latest" \
|
|
-t "${IMAGE}:${GITHUB_SHA}" \
|
|
.
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push "${IMAGE}:latest"
|
|
docker push "${IMAGE}:${GITHUB_SHA}"
|
|
echo "pushed ${IMAGE}:latest and ${IMAGE}:${GITHUB_SHA}"
|