trustcafe-api-wrapper/.gitlab-ci.yml
2026-04-07 13:06:08 +00:00

46 lines
1.1 KiB
YAML

workflow:
name: 'Trust Cafe API Wrapper testing pipeline'
variables:
UV_VERSION: "0.11.2"
PYTHON_VERSION: "3.13"
BASE_LAYER: trixie-slim
# BASE_LAYER: ubuntu:24.04
# GitLab CI creates a separate mountpoint for the build directory,
# so we need to copy instead of using hard links.
UV_LINK_MODE: copy
stages:
- test
- publish
test:
stage: test
# image: python313
# image:
# name: ghcr.io/astral-sh/uv:$UV_VERSION
# entrypoint: [""]
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
script:
- uv sync --frozen
- source .venv/bin/activate
- python unittests.py
publish:
stage: publish
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_BRANCH == "main"'
when: on_success
# - if: '$CI_PIPELINE_SOURCE == "push"'
# when: never # Prevent pipeline run for push event
- when: never
needs:
- test
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
script:
- uv build
- uv publish