From 0a383889523827781f9057d42794ac7a3351d579 Mon Sep 17 00:00:00 2001
From: Bryan Brancotte <bryan.brancotte@pasteur.fr>
Date: Tue, 15 Feb 2022 15:13:21 +0100
Subject: [PATCH] add postgres service

---
 .gitlab-ci.yml | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0c6d979..6ee8ba7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,11 +1,17 @@
 image: docker:latest
 
+variables:
+  POSTGRES_HOST: "db-local"
+  POSTGRES_DBNAME: "postgres"
+  POSTGRES_USER: "postgres"
+  POSTGRES_PASSWORD: "test"
+
 stages:
   - test
 
 test-style:
   stage: test
-  needs: []
+  image: python:3.9
   script:
     - pip install -q -r requirements-test.txt
     - black ./autocomplete_multi_models/ --check --diff --config ./pyproject.toml
@@ -13,6 +19,9 @@ test-style:
 test:
   stage: test
   image: python:3.9
+  services:
+    - name: postgres:14
+      alias: "db-local"
   script:
-    - pip3 install -r requirements.txt -r requirements-test.txt
+    - pip install -r requirements.txt -r requirements-test.txt
     - coverage report --skip-covered --omit=*/wsgi.py,*/asgi.py,manage.py,*/apps.py,setup.py
-- 
GitLab