canaille-globuzma/.gitlab-ci.yml

80 lines
1.9 KiB
YAML
Raw Permalink Normal View History

2020-08-18 15:39:34 +00:00
---
stages:
- test
- build
- release
2024-10-28 08:01:52 +00:00
variables:
UV_VERSION: 0.4
UV_CACHE_DIR: .uv-cache
BASE_LAYER: bookworm-slim
2023-08-13 11:16:42 +00:00
cache:
2024-10-28 08:01:52 +00:00
- key:
files:
- uv.lock
paths:
- $UV_CACHE_DIR
2020-08-18 15:39:34 +00:00
2024-10-28 08:01:52 +00:00
before_script:
- apt update
- env DEBIAN_FRONTEND=noninteractive apt install --yes --quiet gcc python3-dev libldap2-dev libsasl2-dev libssl-dev slapd ldap-utils git curl
# Rust is needed to install the zxcvbn dependency
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- export PATH="$HOME/.cargo/bin:$PATH"
2021-11-17 10:11:20 +00:00
2024-10-28 08:01:52 +00:00
style:
variables:
PYTHON_VERSION: "3.13"
2024-10-28 08:01:52 +00:00
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
2022-11-01 10:49:26 +00:00
stage: test
2023-08-13 11:16:42 +00:00
script:
2024-10-28 08:01:52 +00:00
- uv sync --all-extras
- uv run pre-commit run --all-files --show-diff-on-failure
- uv cache prune --ci
2022-11-01 10:49:26 +00:00
2024-10-28 08:01:52 +00:00
coverage:
variables:
PYTHON_VERSION: "3.12"
2024-10-28 08:01:52 +00:00
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
2023-11-01 19:22:26 +00:00
stage: test
script:
2024-10-28 08:01:52 +00:00
- uv sync --all-extras
- uv pip install coveralls pyyaml tomli
- uv run pytest --cov --cov-fail-under=100 --cov-report term:skip-covered -n auto
- uv run coveralls
- uv cache prune --ci
2023-11-01 19:22:26 +00:00
2024-10-28 08:01:52 +00:00
tests:
needs: ["coverage", "style"]
parallel:
matrix:
- PYTHON_VERSION: ['3.10', '3.11', '3.12']
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
2024-10-27 10:21:42 +00:00
stage: test
script:
2024-10-28 08:01:52 +00:00
- uv sync --all-extras
- uv run pytest
- uv cache prune --ci
2024-10-27 10:21:42 +00:00
minversions:
2024-10-28 08:01:52 +00:00
needs: ["tests"]
variables:
PYTHON_VERSION: "3.10"
2024-10-28 08:01:52 +00:00
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
stage: test
script:
2024-10-28 08:01:52 +00:00
- uv sync --all-extras --resolution=lowest-direct
- uv run pytest
- uv cache prune --ci
2020-11-06 10:44:25 +00:00
doc:
2024-10-28 08:01:52 +00:00
variables:
PYTHON_VERSION: "3.13"
2024-10-28 08:01:52 +00:00
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
2020-08-19 07:18:38 +00:00
stage: test
2020-08-19 07:24:07 +00:00
script:
2024-10-28 08:01:52 +00:00
- uv sync --group doc
- uv run sphinx-build doc build/sphinx/html --fail-on-warning
2024-10-28 08:01:52 +00:00
- uv cache prune --ci