diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d5661e..2e35fe4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,21 +1,8 @@ version: 2 jobs: - build: + install: 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: pip install -r requirements/dev.txt - test: - docker: - image: circleci/postgres:9.6.5 environment: POSTGRES_DB: example @@ -31,22 +18,31 @@ jobs: - 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: FLASK_APP: /home/circleci/repo/autoapp.py FLASK_DEBUG: 0 - command: flask db upgrade + command: | + . venv/bin/activate + flask db upgrade - run: name: Flask test - command: flask test - + environment: + FLASK_APP: /home/circleci/repo/autoapp.py + FLASK_DEBUG: 0 + command: | + . venv/bin/activate + flask test workflows: version: 2 build-test: jobs: - - build - - test: - requires: - - build \ No newline at end of file + - install \ No newline at end of file