ci: simplify workflows with uv - #291
Open
jakob1379 wants to merge 3 commits into
Open
Conversation
setup-uv provides the interpreter, so actions/setup-python is redundant; uv run syncs the environment on demand, so the separate uv sync step is too. Every job drops from 4-5 setup steps to 2. - drop actions/setup-python (setup-uv's python-version replaces it) - fold "Install dependencies" into the test step via uv run --extra - uv build instead of pip install build && python -m build - UV_LOCKED at workflow level: CI now fails if uv.lock is stale - enable-cache on setup-uv Behaviour is unchanged: the old jobs ran `uv sync --group test --no-dev` and then a bare `uv run`, which re-synced the default (dev) group anyway, so dev is what CI has always installed. The build job keeps --no-dev since it only ever installed runtime deps.
Drops actions/setup-python and the pip install build bootstrap. Same
backend, same PEP 625 artifact names, so the AUR job's
dist/sqlit_tui-${VERSION}.tar.gz lookup is unaffected.
Four deletions, no behaviour change: - setup-uv v5 -> v7, which defaults enable-cache to "auto" (on for GitHub-hosted runners), so 15 explicit enable-cache lines go away. v7 is the newest moving major tag that actually exists; v8/v9 are published only as full version tags. - UV_PYTHON at workflow level, overridden per matrix job, replaces 15 copies of setup-uv's python-version input. uv provisions the interpreter either way. - Drop -v from every pytest call; pyproject already sets addopts = "-v". - Drop the trailing "docker stop/rm" Cleanup steps from test-ssh and test-turso. Runners are ephemeral, and the four other docker-run jobs never had them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplementation of the CI half of #157, which you closed as "several separate ideas bundled together". Split into focused commits so each can land on its own.
ci.ymldrops from 607 to 486 lines with no change in what CI covers. Job names are unchanged, so required status checks keep matching.Commits
ci: drive CI entirely through uvsetup-uvsupplies the interpreter, soactions/setup-pythonis redundant.uv runsyncs on demand, so the standaloneuv syncstep is too. Every job goes from 4 or 5 setup steps to 2:Also
uv buildin place ofpip install build && python -m build, andUV_LOCKEDat workflow level so CI fails on a staleuv.lock.ci(release): build the package with uv buildThe same swap in
release.yml. Nothing else in that workflow is touched. Publish and AUR are left alone on purpose, since churn there buys nothing. Same build backend and same PEP 625 artifact names, so the AUR job'sdist/sqlit_tui-${VERSION}.tar.gzlookup is unaffected.ci: cut redundant workflow configFour deletions:
setup-uvv5 to v7, which defaultsenable-cachetoautoand removes 15 explicit lines. v7 is the newest moving major tag that actually exists; v8 and v9 are published only as full version tags. That is the same class of mistake you caught with the AUR action in ci: simplify uv-based CI and release workflows #157, so I checkedgit ls-remotethis time.UV_PYTHONat workflow level, overridden per matrix job, replacing 15 copies of setup-uv'spython-versioninput.-vdropped from every pytest call, sincepyproject.tomlalready setsaddopts = "-v".docker stop/rmcleanup steps intest-sshandtest-turso. Runners are ephemeral, and the four otherdocker runjobs never had them.Why not the approach in #157
Its deduplication relied on YAML anchors (
&checkout-step/*checkout-step). GitHub Actions does not expand aliases, so that could never have worked. This PR gets the same effect from workflow-levelenvand action defaults instead.One behaviour note worth knowing
The old jobs ran
uv sync --group test --no-devand then a bareuv run, which re-syncs the default (dev) group. So--no-devnever actually took effect, and CI has always installeddev. This PR preserves that.An earlier draft of mine "fixed" it with
UV_NO_DEV=1and silently skipped the 11tests/performancetests, becauseFakerlives indevand the fileskipifs itself away when it is missing. Making--no-devreal would needFakerandpytest-benchmarkmoved into thetestgroup, which is apyproject.tomlchange and not bundled here.Verification
actionlintclean on both files. Locally, withUV_LOCKED=1:The single failure,
test_detect_strategy_pip_user_fallback, is pre-existing and environment-dependent. The probe reads real interpreter state, and my machine reportsexternally-managedwhere the test expectspip-user. It fails identically on unmodifiedmain.I also could not get a clean local reading on
tests/performance, which asserts wall-clock thresholds. Those tests passed standalone, then failed inside a full run while my machine was busy with other test invocations. Not caused by this PR, since they already run in the current unit job, but they look like a latent flake worth a separate look.Deliberately left out
Happy to open any of these separately if you want them:
services:accepts matrix expressions, but four jobs use rawdocker run, mssql needs a wait step, mariadb needs apt, and firebird has no healthcheck. The resultinginclude:block is harder to read than 13 explicit jobs.buildbuilds the samepy3-none-anywheel four times. It could collapse to one job, withtest-unitwidened to all four versions instead. That is fewer jobs and more real coverage, at roughly double the unit-job wall time.--ignorelist.tests/integration/already exists andpytest.mark.integrationis already declared inpyproject.toml, but the DB test files use neither. Marking or moving them turns that list into-m "not integration".softprops/action-gh-release@v1inrelease.yml. actionlint flags it as too old to run on GitHub Actions (node16). Pre-existing, one character to fix, own PR.