version: 2.1 executors: node-executor: docker: - image: circleci/node:12 auth: username: $DOCKERHUB_LOGIN password: $DOCKERHUB_PASSWORD node-and-postgresql-executor: docker: - image: circleci/node:12 auth: username: $DOCKERHUB_LOGIN password: $DOCKERHUB_PASSWORD - image: circleci/postgres:9.6.2-alpine auth: username: $DOCKERHUB_LOGIN password: $DOCKERHUB_PASSWORD environment: DATABASE_URL: "postgres://psqluser@localhost:5432/psdb" JWT_SECRET: string API_PORT: 3000 API_HOST: localhost API_PROTOCOL: http POSTGRES_USER: psqluser POSTGRES_PASSWORD: password POSTGRES_DB: psdb jobs: build: executor: node-executor steps: - checkout - run: name: Install dependencies command: yarn global add node-gyp && yarn install - save_cache: name: Save Yarn package cache key: npm-v7-dependencies-{{ checksum "yarn.lock" }} paths: - ./node_modules lint: executor: node-executor steps: - checkout - restore_cache: name: Restore yarn package cache key: npm-v7-dependencies-{{ checksum "yarn.lock" }} - run: name: Analyse code with tslint and format with prettier command: yarn lint && yarn format:check test: executor: node-executor steps: - checkout - restore_cache: name: Restore yarn package cache key: npm-v7-dependencies-{{ checksum "yarn.lock" }} - run: name: Run test with jest command: yarn test:ci test_end_to_end: executor: node-and-postgresql-executor steps: - checkout - restore_cache: name: Restore yarn package cache key: npm-v7-dependencies-{{ checksum "yarn.lock" }} - run: name: Run end to end test command: yarn test:e2e workflows: version: 2 integration: jobs: - build - lint: requires: - build - test: requires: - build - test_end_to_end: requires: - build