version: 2.1 workflows: build_and_test: jobs: - build - lint: requires: - build - test: requires: - build - e2e-test: requires: - build jobs: build: docker: - image: cimg/node:14.10.1 steps: - checkout - restore_cache: name: Restore Yarn Package Cache key: yarn-packages-v2{{ checksum "yarn.lock" }} - run: name: Install dependencies command: yarn global add node-gyp && yarn install - save_cache: name: Save Yarn Package Cache key: yarn-packages-v2{{ checksum "yarn.lock" }} paths: - ./node_modules lint: docker: - image: cimg/node:14.10.1 steps: - checkout - restore_cache: name: Restore Yarn Package Cache key: yarn-packages-v2{{ checksum "yarn.lock" }} - run : name: "Lint Code" command: yarn lint && yarn format:check test: docker: - image: cimg/node:14.10.1 steps: - checkout - restore_cache: name: Restore Yarn Package Cache key: yarn-packages-v2{{ checksum "yarn.lock" }} - run : name: "Unit Test" command: yarn test:ci e2e-test: docker: - image: cimg/node:14.10.1 environment: DATABASE_URL: postgresql://jordan:mot_de_passe@localhost:5432/psdb JWT_SECRET: mot_de_passe API_PORT: 3000 API_HOST: localhost API_PROTOCOL: http - image: circleci/postgres:9-postgis-ram environment: POSTGRES_USER: jordan POSTGRES_DB: psdb POSTGRES_PASSWORD: mot_de_passe steps: - checkout - restore_cache: name: Restore Yarn Package Cache keys: yarn-packages-v2{{ checksum "yarn.lock" }} - run: name: "E2e Test" command: yarn test:e2e