From 5683ed8f01e7a7fc22e6ea3be306e4f8405d3ba7 Mon Sep 17 00:00:00 2001 From: Adrien-Ba Date: Sat, 15 Jan 2022 11:12:11 +0100 Subject: [PATCH] Do a CI with Test :construction_worker: Create CI with all tests - Build - Lint - Back test unit - Back test end to end --- .circleci/config.yml | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..b85420b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,70 @@ +version: 2 +jobs: + build: &shared-config + docker: + - image: circleci/node:lts-fermium + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - dependencies-{{ checksum "package.json" }}-v1 + - dependencies- + - run: yarn install + - save_cache: + paths: + - node_modules + key: dependencies-{{ checksum "package.json" }}-v1 + + lint: + <<: *shared-config + steps: + - checkout + - restore_cache: + key: dependencies-{{ checksum "package.json" }}-v1 + - run: yarn lint + - run: yarn format:check + + back-test-unit: + <<: *shared-config + steps: + - checkout + - restore_cache: + key: dependencies-{{ checksum "package.json" }}-v1 + - run: + command: yarn test + environment: + DATABASE_URL: postgres://psqluer:psqlpassword@localhost:5432/psqluer + + back-test-e2e: + docker: + - image: circleci/node:lts-fermium + - image: circleci/postgres:9.6.5 + environment: + POSTGRES_DB: psqluer + POSTGRES_USER: psqluer + POSTGRES_PASSWORD: psqlpassword + working_directory: ~/repo + steps: + - checkout + - restore_cache: + key: dependencies-{{ checksum "package.json" }}-v1 + - run: + command: yarn test:e2e + environment: + DATABASE_URL: postgres://psqluer:psqlpassword@localhost:5432/psqluer + +workflows: + version: 2 + build-test-and-lint: + jobs: + - build + - back-test-unit: + requires: + - build + - back-test-e2e: + requires: + - build + - lint: + requires: + - build \ No newline at end of file