-
Notifications
You must be signed in to change notification settings - Fork 20
/
.gitlab-ci.yml
43 lines (39 loc) · 1.03 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
stages:
- test
- build
- deploy
- management
# jobs for build, deploy and management are in these included files
include:
- local: /gitlab-ci/do-base.yml
- local: "/gitlab-ci/dev.yml"
image: docker:19.03.1
services:
- docker:19.03.5-dind
Pytest:
image: python:3.8
stage: test
services:
- postgres:13.1
- redis:6.0.9-alpine
variables:
DJANGO_SETTINGS_MODULE: "backend.settings.gitlab_ci"
# the database name is too long, setting here explicitly
# DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/postgres"
POSTGRES_DB: ci
POSTGRES_NAME: ci
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: "trust"
POSTGRES_SERVICE_HOST: "postgres"
REDIS_SERVICE_HOST: "redis"
SECRET_KEY: "secret"
DEBUG: "1"
script:
- cd backend
- pip install -r requirements/base.txt
- pip install -r requirements/test.txt
- flake8
- black -l 79 -S --diff .
- pytest --cov --cov-config=.coveragerc
coverage: '/TOTAL.+ ([0-9]{1,3}\.[0-9]{1,3}%)/'