aboutsummaryrefslogblamecommitdiffstats
path: root/.gitlab-ci.yml
blob: 5e32d2a17fd24df13c14d007c0a5ca6296c985f7 (plain) (tree)






































                                                                          
stages:
  - lint
  - test

variables:
  POSTGRES_USER: 'pyblackbird_cc'
  POSTGRES_PASSWORD: ''
  POSTGRES_DB: 'test_pyblackbird_cc'
  POSTGRES_HOST_AUTH_METHOD: trust
  CELERY_BROKER_URL: 'redis://redis:6379/0'

precommit:
  stage: lint
  image: python:3.12
  variables:
    PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
  cache:
    paths:
      - ${PRE_COMMIT_HOME}
  before_script:
    - pip install -q pre-commit
  script:
    - pre-commit run --show-diff-on-failure --color=always --all-files

pytest:
  stage: test
  image: docker:25.0
  tags:
    - docker
  services:
    - docker:dind
  before_script:
    - docker compose -f local.yml build
    - docker compose -f docs.yml build
    # Ensure celerybeat does not crash due to non-existent tables
    - docker compose -f local.yml run --rm django python manage.py migrate
    - docker compose -f local.yml up -d
  script:
    - docker compose -f local.yml run django pytest