Yield generated for e5648a57-7187-4b40-9453-05010c908229
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.
 
 
 

59 lines
1.6 KiB

version: 2
jobs:
build:
docker:
- image: circleci/python:3.9.1
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run:
name: Install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements/dev.txt
test:
docker:
- image: circleci/postgres:9.6.5
environment:
POSTGRES_DB: example
POSTGRES_USER: circleci
POSTGRES_PASSWORD: somePwd
POSTGRES_PORT: 5432
DATABASE_URL: postgresql://circleci:somePwd@localhost:5432/example
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run:
name: Setup dababase
environment:
FLASK_APP: /home/circleci/repo/autoapp.py
FLASK_DEBUG: 0
command: |
. venv/bin/activate
flask db upgrade
- run:
name: Flask test
command: |
. venv/bin/activate
flask test
workflows:
version: 2
build-test:
jobs:
- build
- test:
requires:
- build