From 5e7eb3a53f1452c0d09179cb949bb56946f5235e Mon Sep 17 00:00:00 2001 From: Neel-Leo Coffin Date: Tue, 12 Jan 2021 15:51:43 +0100 Subject: [PATCH] :construction_worker: add test and db to ci --- .circleci/config.yml | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7502217..ab5d294 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,4 +16,43 @@ jobs: - save_cache: key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} paths: - - "venv" \ No newline at end of file + - "venv" + test: + docker: + - image: cimg/node:14.10.1 + steps: + - checkout + - restore_cache: + key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} + - run: + name: Waiting for postgresql + command : dockerize -wait tcp://localhost:5432 -timeout 1m + - run: + name: Launching tests + command: | + . venv/bin/activate + flask db upgrade + flask test + database: + docker: + - image: circleci/python:3.9-buster-node-browsers + environment: + DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/myUsr + FLASK_APP: autoapp.py + CONDUIT_SECRET: 'something' + FLASK_DEBUG: 1 + - image: circleci/postgres:9.6.2-alpine + environment: + POSTGRES_USER: myUsr + POSTGRES_DB: psdb + POSTGRES_PASSWORD: somePwd +workflows: + build_and_test: + jobs: + - build + - test: + requires: + - build + - database: + requires: + - build