From efbbd480ddc62e695123d31c31d233b0df5155bd Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 13 May 2024 17:26:25 +0100 Subject: After first pre-commit processing --- .gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitlab-ci.yml (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5e32d2a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,39 @@ +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 -- cgit v1.2.3