Browse Source

💚 Add test job

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

32
.circleci/config.yml

@ -3,6 +3,22 @@ jobs:
build: build:
docker: docker:
- image: circleci/python:3.9.1 - 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 - image: circleci/postgres:9.6.5
environment: environment:
POSTGRES_DB: example POSTGRES_DB: example
@ -13,18 +29,11 @@ jobs:
working_directory: ~/repo working_directory: ~/repo
steps: steps:
- checkout - checkout
- setup_remote_docker
- restore_cache: - restore_cache:
keys: keys:
- dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }} - dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
# fallback to using the latest cache if no exact match is found # fallback to using the latest cache if no exact match is found
- dependencies- - dependencies-
- run:
name: Install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements/dev.txt
- run: - run:
name: Setup dababase name: Setup dababase
environment: environment:
@ -33,9 +42,18 @@ jobs:
command: | command: |
. venv/bin/activate . venv/bin/activate
flask db upgrade flask db upgrade
- run:
name: Flask test
command: |
. venv/bin/activate
flask test
workflows: workflows:
version: 2 version: 2
build-test: build-test:
jobs: jobs:
- build - build
- test:
requires:
- build
Loading…
Cancel
Save