subscleaner/.gitlab-ci.yml

55 lines
1005 B
YAML

image: python:latest
stages:
- lint
- test
- deploy
before_script:
- pip install poetry
- poetry install --no-root
lint:
stage: lint
script:
- poetry run ruff check
- poetry run ruff format --check
test:
stage: test
script:
- poetry run pytest -v --cov=. --cov-report=xml
after_script:
- bash <(curl -s https://codecov.io/bash)
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
deploy_to_pypi:
stage: deploy
only:
refs:
- master
changes:
- pyproject.toml
script:
- POETRY_PYPI_TOKEN_PYPI=$PYPI_PASSWORD poetry publish --build
deploy_to_dockerhub:
stage: deploy
only:
refs:
- master
changes:
- Dockerfile
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker buildx create --use
script:
- docker buildx build --push --tag roger/subscleaner:latest .