You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.7 KiB
65 lines
1.7 KiB
---
|
|
jobs:
|
|
build:
|
|
docker:
|
|
-
|
|
image: "circleci/python:latest"
|
|
steps:
|
|
- checkout
|
|
-
|
|
restore_cache:
|
|
key: "deps1-{{ .Branch }}-{{ checksum \"requirements/dev.txt/prod.txt\" }}"
|
|
-
|
|
run:
|
|
command: |
|
|
python3 -m venv venv
|
|
. venv/bin/activate
|
|
pip install -r requirements/dev.txt
|
|
name: "Install Python deps in a venv"
|
|
-
|
|
save_cache:
|
|
key: "deps1-{{ .Branch }}-{{ checksum \"requirements/dev.txt/prod.txt\" }}"
|
|
paths:
|
|
- venv
|
|
flask_tests:
|
|
docker:
|
|
-
|
|
environment:
|
|
CONDUIT_SECRET: something-really-secret
|
|
DATABASE_URL: "postgresql://denis:denis@localhost:5432/postgres?sslmode=disable"
|
|
FLASK_APP: autoapp.py
|
|
FLASK_DEBUG: 1
|
|
image: "circleci/python:latest"
|
|
-
|
|
environment:
|
|
POSTGRES_BD: postgres
|
|
POSTGRES_PASSWORD:
|
|
POSTGRES_USER: denis
|
|
image: "circleci/postgres:9.6.9-alpine-ram"
|
|
steps:
|
|
- checkout
|
|
-
|
|
restore_cache:
|
|
key: "deps1-{{ .Branch }}-{{ checksum \"requirements/dev.txt/prod.txt\" }}"
|
|
-
|
|
run:
|
|
command: "dockerize -wait tcp://localhost:5432 -timeout 1m"
|
|
name: "Attente de postgres"
|
|
-
|
|
run:
|
|
command: |
|
|
. venv/bin/activate
|
|
flask db stamp head
|
|
flask db migrate
|
|
flask db upgrade
|
|
flask test
|
|
name: "Tests Flask"
|
|
workflows:
|
|
test:
|
|
jobs:
|
|
- build
|
|
-
|
|
flask_tests:
|
|
requires:
|
|
- build
|
|
version: 2
|