diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8c58dc9 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,56 @@ +version: 2.1 +jobs: + build: + docker: + - image: circleci/python:3.7.9-stretch-browsers + steps: + - checkout + - restore_cache: + key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} + - run: + name: Install dependencies in a python venv + command: | + python3 -m venv venv + venv/bin/activate + pip install -r requirements/dev.txt + - save_cache: + key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} + paths: + - "venv" + test: + docker: + - image: circleci/python:3.7.9-stretch-browsers + environment: + DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/psdb + FLASK_APP: autoapp.py + CONDUIT_SECRET: 'something-really-secret' + FLASK_DEBUG: 1 + - image: circleci/posgres:9.6.2-alpine + environment: + POSTGRES_USER: myUsr + POSTGRES_DB: psdb + POSTGRES_PASSWORD: somePwd + 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: | + flask db upgrade + flask test + +workflows: + build_test_deploy: + jobs: + - build + - test: + requires: + - build + + + +