Browse Source

💚 Add test job

main
Pierre Fontaine 5 years ago
parent
commit
30b15b404c
  1. 34
      .circleci/config.yml

34
.circleci/config.yml

@ -3,6 +3,22 @@ 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
@ -13,18 +29,11 @@ jobs:
working_directory: ~/repo
steps:
- checkout
- setup_remote_docker
- 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
- run:
name: Setup dababase
environment:
@ -33,9 +42,18 @@ jobs:
command: |
. venv/bin/activate
flask db upgrade
- run:
name: Flask test
command: |
. venv/bin/activate
flask test
workflows:
version: 2
build-test:
jobs:
- build
- build
- test:
requires:
- build
Loading…
Cancel
Save