version: 2 jobs: build: docker: - image: circleci/python:3.9-buster-node-browsers steps: - checkout - restore_cache: key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} - run: name: Installation des dépendances python 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" flask_tests: docker: - image: circleci/postgres:9.6.9-alpine environment: POSTGRES_USER: myUsr POSTGRES_PASSWORD: somePwd POSTGRES_BD: psdb - image: circleci/python:3.9-buster-node-browsers environment: DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/psdb CONDUIT_SECRET: 'something-really-secret' FLASK_APP: autoapp.py FLASK_DEBUG: 1 steps: - checkout - restore_cache: key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} - run: name: Attente de postgres command: dockerize -wait tcp://localhost:5432 -timeout 1m workflows: tp: jobs: - build - flask_tests: requires: - build