Files
mcp-ics/.gitea/workflows/_ci-common.yaml
T
jcabillot ef3ec3ba54
Lint / hadolint (pull_request) Successful in 28s
CI Shared Jobs / hadolint (pull_request) Successful in 28s
CI Shared Jobs / build-test (pull_request) Successful in 2m33s
CI Shared Jobs / pytest (pull_request) Successful in 2m57s
PR Checks / ci (pull_request) Successful in 3m26s
test: pytest suite (31 tests) + lazy config validation + CI pytest job
- src/server.py: CALDAV_DATA_PATH validation moved from import-time to
  _validate_startup_config(), called on __main__ or MCP_ICS_VALIDATE_ON_IMPORT=1.
  Module is now importable in tests without env setup.
- tests/: Radicale fixture tree (VCALENDAR/VADDRESSBOOK, hidden dirs, corrupt
  props, bad ics), covers discover_calendars, parse_ics_files, component_to_dt,
  format_dt, format_component (exclude/birthday filters, VEVENT vs VTODO shape),
  get_events_in_range (RRULE expansion, cross-calendar aggregation, sort),
  get_agenda (default +7d end, error dict, flag forwarding), /health endpoint,
  _validate_startup_config. 31 tests, <2s.
- .gitea/workflows/_ci-common.yaml: new pytest job running the test suite
  inside the built CI image (prod requirements).
- pkg/Dockerfile: COPY tests/
2026-10-09 00:06:27 +00:00

57 lines
1.9 KiB
YAML

name: CI Shared Jobs
on:
workflow_call:
jobs:
hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: hadolint/hadolint-action@06be81baf89a55ffd0e24b8f04a4185738dd3387 # v3.5.0
with:
dockerfile: pkg/Dockerfile
failure-threshold: warning
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- name: Build (cached)
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: pkg/Dockerfile
push: false
load: true
tags: ci-image:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke test (compile sanity)
run: docker run --rm --name mcp-ics-smoke-$(hostname) ci-image:${{ github.sha }} python -m compileall -q src/
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- name: Build (cached)
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: pkg/Dockerfile
push: false
load: true
tags: ci-image:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Unit tests (pytest, in-image env with prod requirements)
run: >
docker run --rm ci-image:${{ github.sha }}
sh -c "pip install pytest --quiet && python -m pytest tests/ -q"