krz/hutch-stats

Server-side utility for calculating contributions for sourcehut users. contributions server sourcehut stats

Commit ef33a66392

ef33a663928825f0c5b51d31c5e3f376ac0bf1b0

parent: bc9afc9156

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-22 20:02 UTC

Run the tests in CI

The service had no workflows: 46 tests that ran only when someone remembered.
Six dependency bumps were merged in one sitting with nothing verifying them.

Installs with uv, since uv.lock is committed and is what dependabot updates, so
CI has to resolve through it rather than pip-installing whatever is newest.

--locked rather than --frozen: --frozen installs from the lockfile without
consulting pyproject.toml, so a manifest that has drifted past its lock installs
happily and CI stays green. --locked fails instead. Checked both ways against a
deliberately drifted constraint before picking.

Layout: unified · split

.github/workflows/test.yml added +35
@@ -0,0 +1,35 @@
1name: Test
2
3# This service had no CI at all: 46 tests under tests/ that ran only when
4# someone remembered to. Six dependency bumps were merged in one sitting with
5# nothing verifying them, which is the failure this exists to prevent.
6on:
7 pull_request:
8 push:
9 branches: [main]
10
11permissions:
12 contents: read
13
14jobs:
15 test:
16 runs-on: ubuntu-latest
17 steps:
18 - uses: actions/checkout@v7
19
20 # uv is how the project is actually developed — uv.lock is committed and
21 # is what dependabot updates, so CI must resolve through it rather than
22 # pip-installing whatever is newest.
23 - uses: astral-sh/setup-uv@v10
24 with:
25 enable-cache: true
26
27 # --locked, not --frozen. --frozen installs from the lockfile without
28 # looking at pyproject.toml, so a manifest that has drifted past its lock
29 # installs happily; --locked fails instead. Verified both ways against a
30 # deliberately drifted constraint.
31 - name: Install
32 run: uv sync --extra dev --locked
33
34 - name: Tests
35 run: uv run pytest -q