mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 21:27:14 +01:00
sickdays: per-date pool, no cap or reason, add/remove today or later only, import_legacy for the migration. LWW state flip per date (no tombstones), Firebase RTDB sickdays-sync/devices/<uuid>/sick_days.json, HMAC audit trail. Readers fail closed (unreadable pool = not sick, logged); writers refuse a corrupt pool. Free-day cross-check via a lazily imported freedays predicate. earned_time: resolve(..., sick=True) floors the final shutdown at 20:00 (capped at the ceiling); gaming, terms and base unchanged. Result dataclasses moved to _resolution.py for the line cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xfj1sxKH9VBPqpcAni8Jry
45 lines
1.5 KiB
YAML
45 lines
1.5 KiB
YAML
name: sickdays tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
# The workflow's own file counts as sickdays: editing only this file would
|
|
# otherwise trigger nothing, so a fix to the job itself could never prove
|
|
# itself.
|
|
paths: ['sickdays/**', '.github/workflows/sickdays-tests.yml']
|
|
pull_request:
|
|
branches: [main]
|
|
paths: ['sickdays/**', '.github/workflows/sickdays-tests.yml']
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: sickdays
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
cache: pip
|
|
cache-dependency-path: sickdays/requirements.txt
|
|
|
|
# crdt-sync and freedays are siblings in this repo, so they install from
|
|
# the checkout rather than from a tag -- CI must test what is on this
|
|
# branch, not what was last released. Deliberately NOT gatelock:
|
|
# importing it pulls in tkinter, and this job has no display precisely
|
|
# because sickdays must work without one.
|
|
- name: Install the sibling packages
|
|
run: pip install ../crdt-sync && pip install --no-deps ../freedays
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt && pip install --no-deps -e .
|
|
|
|
# No display needed: sickdays draws nothing. It is policy, a JSON file
|
|
# and a CLI.
|
|
- name: Run tests with coverage
|
|
run: python -m pytest -v
|