port matrix-ops-bot to uv and nix flake module

This commit is contained in:
Abel Luck 2026-03-05 15:55:47 +01:00
parent c13d5fc536
commit 3a042155af
17 changed files with 2402 additions and 3476 deletions

View file

@ -3,47 +3,13 @@ image: python:3.11
stages:
- check
- build
check:
image: python:3.11-bookworm
stage: check
script:
- apt-get update
- apt-get install -y make libolm-dev python3-poetry
- poetry install
- make check
variables:
UNIQUE_IMAGE: registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:$CI_COMMIT_SHORT_SHA
REF_IMAGE: registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:$CI_COMMIT_REF_NAME
build-test:
image: docker:latest
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# speed up build time by pulling the old image
- docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main
- docker build -t $UNIQUE_IMAGE .
- docker push $UNIQUE_IMAGE
except:
- main
- tags
build:
image: docker:git
stage: build
services:
- docker:dind
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# speed up build time by pulling the old image
- docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main
- docker build --no-cache -t $UNIQUE_IMAGE .
- docker push $UNIQUE_IMAGE
- docker tag $UNIQUE_IMAGE $REF_IMAGE
- docker push $REF_IMAGE
only:
- main
- tags
- apt-get install -y make libolm-dev
- pip install uv
- uv sync --frozen --group dev
- uv run make check