Repository navigation
ci: GitLab pipeline with lint, test and release jobs - #18
Merged
Merged
Conversation
.gitlab-ci.yml for a GitLab instance, kept in step with the GitHub workflows: one pipeline per change (merge request pipelines win over branch pipelines), lint (black, flake8, mypy, pip-audit) and test (postgres:17 service, JUnit report in the merge request widget) on every change, and on a v* tag the release jobs: verify (scripts/release.py, nothing installed), build (poetry build) and release (glab, job-token login, wheel and sdist in the generic package registry and linked from the release page). Python comes from PYTHON_VERSION, checked against .python-version so the two cannot drift; Poetry from poetry.lock's header. Validated with the instance's CI lint API (GitLab 19.2). Docs describe both hosts; the adapting list names the GitLab variables. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
After the push, the script prints where the release pipeline runs: /actions on github.com, /-/pipelines elsewhere, parsed from the three remote URL spellings (scp-like, ssh:// with a port, https). Tested. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
A GitLab CI/CD pipeline for the services that live on the self-hosted instance, mirroring the GitHub workflows so a clone can carry either file or both.
.gitlab-ci.ymllint(black, flake8, mypy, pip-audit) andtest(postgres:17service, JUnit report so results show in the merge request widget) on every change, with pip and Poetry caches keyed onpoetry.lock.poetry.lock's header; Python from.python-version, which the image tag cannot read, soPYTHON_VERSIONrepeats the minor and the job fails if the two disagree.v*tag:verify(the standard-library script checks tag vspyproject.tomland extracts the notes),build(poetry build),release(glab release createwith job-token login; wheel and sdist go to the project's generic package registry and are linked from the release page).release-cliis deprecated since GitLab 18.0, so this uses thegitlab-org/cliimage, pinned.scripts/release.py: after the push it prints the pipeline URL for the remote it pushed to (/actionson github.com,/-/pipelineselsewhere), parsing scp-like,ssh://with a port, and https remotes. Six new tests.Docs: releasing, setup, README, AGENTS and Known Issues describe both hosts; the adapting list names the GitLab variables; the releasing doc tells a GitLab project what to check if the first release's asset upload is refused by the job token.
Not included
A deploy job. The KorvynApi pipeline has an SSH deploy that is specific to its server; the starter's Known Issues entry "No deployment story" still covers deployment, and the GitLab pipeline has a
releasestage to hang one on.Verification
--noconftest;check-version v0.1.0passes.valid: true, no errors, no warnings.🤖 Generated with Claude Code