Files
paroles-net-scraper/.gitlab-ci.yml
Rene Luria a60f5274b2 feat: Add Ruff linting, pre-commit hooks, and build scripts
- Configure Ruff for linting and formatting with pre-commit hooks
- Add Makefile with convenient commands for development workflow
- Create build and upload scripts for Gitea package registry
- Update README with documentation for new features
- Fix code quality issues identified by Ruff
- Add development dependencies (ruff, pre-commit) to pyproject.toml
- Update Python version requirement to >=3.9
- Add template for Gitea PyPI configuration
- Bump version to 0.3.0
- All tests passing and code properly formatted
2025-08-11 14:49:17 +02:00

74 lines
1.5 KiB
YAML

# GitLab CI configuration for paroles-net-scraper
# Using uv for Python package management
stages:
- test
- build
- deploy
variables:
UV_VERSION: "0.2.25"
PYTHON_VERSION: "3.11"
# Cache uv packages between jobs
cache:
key: uv-cache
paths:
- .uv/
- uv.lock
before_script:
# Install uv if not already available
- which uv || curl -LsSf https://astral.sh/uv/install.sh | sh
# Set up Python environment
- uv python install $PYTHON_VERSION
.test_base:
stage: test
script:
# Sync dependencies
- uv sync --dev
# Run tests
- uv run pytest tests/ -v
test:python-3.11:
extends: .test_base
image: python:3.11-slim
test:python-3.12:
extends: .test_base
image: python:3.12-slim
variables:
PYTHON_VERSION: "3.12"
build-package:
stage: build
image: python:3.11-slim
script:
# Install uv
- which uv || curl -LsSf https://astral.sh/uv/install.sh | sh
# Sync dependencies
- uv sync --dev
# Build the package
- uv build
artifacts:
paths:
- dist/
expire_in: 1 week
# Deploy job (only runs on tags)
deploy-package:
stage: deploy
image: python:3.11-slim
script:
# Install uv
- which uv || curl -LsSf https://astral.sh/uv/install.sh | sh
# Install twine for uploading to PyPI
- uv pip install twine
# Upload to PyPI (using credentials from GitLab CI/CD variables)
- twine upload --username $PYPI_USERNAME --password $PYPI_PASSWORD dist/*
only:
- tags
dependencies:
- build-package