wake-alarm/.github/workflows/python-tests.yml
Krzysztof kuhy Rudnicki 8e6fa90c80
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,free-days-interop) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / free-days-interop (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Bump Flutter to 3.50.0 via material_ui
Flutter 3.50 deprecates package:flutter/material.dart, so the app
moves to material_ui 1.11.0 together with sync_settings_ui 0.8.0
and github_device_auth 0.5.0 (crdt_sync 0.13.1 rides along).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:06:16 +01:00

79 lines
2.6 KiB
YAML

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
# uv with a cached wheel store (and cached builds of the three
# git+ kuhyx/utils packages) installs requirements.txt in seconds;
# plain pip took 22 s of a 32 s job.
- uses: astral-sh/setup-uv@v10.2.0
with:
enable-cache: true
cache-dependency-glob: requirements.txt
- name: Install dependencies
run: uv pip install --system -r requirements.txt
# No -n auto: the whole suite runs in ~0.5 s, and under pytest-xdist it
# measured ~1.2 s locally (worker start-up outweighs the parallelism).
# Coverage and its 100% bar come from pyproject.toml's addopts.
- name: Run tests with coverage
run: python -m pytest -q -p no:sugar
# The Dart free-day rules are a port of ~/src/utils/freedays. This is the
# cross-language gate (scripts/free_days_interop/check.sh): it needs both
# Flutter and the Python package, which the pre-commit job does not have,
# so it runs here and the pre-commit job SKIPs that one hook.
free-days-interop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out the Python side of the pool
uses: actions/checkout@v4
with:
repository: kuhyx/utils
path: .utils
- uses: actions/setup-python@v5
with:
python-version: "3.x"
# This job is the workflow's critical path (the Flutter SDK restore and
# the Dart test are its floor); uv builds the venv in a couple of
# seconds where venv + pip took 12 s.
- uses: astral-sh/setup-uv@v10.2.0
with:
enable-cache: true
cache-dependency-glob: |
.utils/crdt-sync/pyproject.toml
.utils/freedays/pyproject.toml
- name: Install freedays into its own venv
run: |
uv venv --python "$pythonLocation/bin/python" .freedays-venv
uv pip install --quiet --python .freedays-venv/bin/python .utils/crdt-sync
uv pip install --quiet --python .freedays-venv/bin/python --no-deps .utils/freedays
- uses: kuhyx/utils/flutter-setup@flutter-setup-v1
with:
flutter-version: 3.50.0
working-directory: phone_app
- name: Dart writes, Python replays, both must agree
run: FREEDAYS_PYTHON="$PWD/.freedays-venv/bin/python" bash scripts/free_days_interop/check.sh