-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
44 lines (41 loc) · 1014 Bytes
/
.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
44
stages:
- lint
- test
variables:
DJANGO_APPLICATION_ENVIRONMENT: test
POSTGRES_HOST: postgresql
POSTGRES_PORT: 5432
POSTGRES_DB: valorem
POSTGRES_USER: valorem
POSTGRES_PASSWORD: valorem
POETRY_NO_INTERACTION: 1
POETRY_VIRTUALENVS_CREATE: 'false'
POETRY_CACHE_DIR: '/var/cache/pypoetry'
POETRY_HOME: '/usr/local'
lint:
stage: lint
image: python:3.12
script:
- cd api
- pip install poetry
- poetry install --with test
- flake8
test:
stage: test
image: python:3.12
services:
- name: postgres:12.0-alpine
alias: postgresql
variables:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
script:
- cd api
- python -m pip install --upgrade pip
- pip install poetry
- poetry install --with test
- apt-get update && apt-get install -y postgresql-client
- until pg_isready -h postgres -p 5432; do sleep 2; done
- python manage.py migrate
- pytest --cov