aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-13 17:26:25 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-13 17:26:25 +0100
commitefbbd480ddc62e695123d31c31d233b0df5155bd (patch)
treebc2fb465edd5050d83c97f280b1aac8e023fe3e5 /.gitlab-ci.yml
After first pre-commit processing
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml39
1 files changed, 39 insertions, 0 deletions
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