steam-backlog-enforcer/.github/workflows/python-tests.yml
Krzysztof kuhy Rudnicki a76e726e36 Merge steam-game-installer into the repo
The installer ships as the steam_installer package beside
steam_backlog_enforcer, with its tests, docs and Proton lock. The
enforcer's fast install now starts the installer from this checkout.

Both appinfo.vdf readers share one key-value decoder
(steam_installer.appinfo_kv), and the duplicated test fixtures and
helpers are folded into conftest and _cli_helpers so the whole-tree
duplicate-code check is clean. check_requirements_sync treats sibling
packages as first-party.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWZCxnNWLtpVwFLVk9w
2026-11-22 20:25:39 +01:00

71 lines
2.1 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 installs requirements.txt in seconds;
# plain pip took ~20 s of a ~70 s run.
- 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
# -n auto spreads the suite over every runner core (pytest-xdist is in
# requirements.txt); pytest-cov merges the workers' coverage.
- name: Run tests with coverage
run: |
python -m pytest steam_backlog_enforcer/tests/ steam_installer/tests/ \
-n auto \
-p no:sugar \
--cov=steam_backlog_enforcer \
--cov=steam_installer \
--cov-branch \
--cov-fail-under=100 \
-q
# vitest's 100% bar used to run only in the local pre-push hook, which
# became a 1-second stamp check on 2026-09-20 (pre-commit's manual stage
# holds it now). Nothing else in CI runs the web suite, so this job is the
# only place that bar is enforced on every push.
web-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# web/ is a pnpm project (no package-lock.json since the Astro move), so
# npm's cache step had no lockfile to key on and failed the job. No
# `version:`: pnpm/action-setup reads web/package.json's packageManager
# and errors if given both.
- uses: pnpm/action-setup@v4
with:
package_json_file: web/package.json
- uses: actions/setup-node@v4
with:
node-version: 26.13.1
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: vitest --coverage, 100% (web UI)
run: |
pnpm --dir web install --frozen-lockfile
pnpm --dir web run coverage