From dcae9bc20ec70f245f6215db410a1bb7a45520e7 Mon Sep 17 00:00:00 2001 From: Anatole-DC Date: Thu, 13 Jan 2022 17:43:04 +0100 Subject: [PATCH 1/6] :seedling: Add the circleci config file Add the config.yml file to run ci on circleci --- .circleci/config.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..e69de29 From 2bf854551bcb1d83bf464180bb231aef2c4de8d7 Mon Sep 17 00:00:00 2001 From: Anatole-DC Date: Thu, 13 Jan 2022 17:47:56 +0100 Subject: [PATCH 2/6] :construction_worker: Add build step Add backend build step --- .circleci/config.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e69de29..f06d44f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -0,0 +1,24 @@ +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 + # fallback to using the latest cache if no exact match is found + - dependencies- + - run: yarn install + - save_cache: + paths: + - node_modules + key: dependencies-{{ checksum "package.json" }}-v1 + +workflows: + version: 2 + build-test-and-lint: + jobs: + - build \ No newline at end of file From fa5bdcd065acc2bc8f4833ce8fdf40aa592cfeed Mon Sep 17 00:00:00 2001 From: Anatole-DC Date: Thu, 13 Jan 2022 17:54:59 +0100 Subject: [PATCH 3/6] :green_heart: Force CI update --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f06d44f..5f4ca0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,6 @@ jobs: - restore_cache: keys: - dependencies-{{ checksum "package.json" }}-v1 - # fallback to using the latest cache if no exact match is found - dependencies- - run: yarn install - save_cache: From f273bb5c5a3f0ab4731b2158d6b0a07792879df3 Mon Sep 17 00:00:00 2001 From: Anatole-DC Date: Thu, 13 Jan 2022 17:59:53 +0100 Subject: [PATCH 4/6] :construction_worker: Add Lint step Add lint and format check step in ci --- .circleci/config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f4ca0d..cfaa14c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,8 +16,20 @@ jobs: - node_modules key: dependencies-{{ checksum "package.json" }}-v1 + lint: + <<: *shared-config + steps: + - checkout + - restore_cache: + key: dependencies-{{ checksum "package.json" }}-v2 + - run: yarn lint + - run: yarn format:check + workflows: version: 2 build-test-and-lint: jobs: - - build \ No newline at end of file + - build + - lint: + requires : + - build \ No newline at end of file From 8b78b79a1c5d8ee85805e7f294899188b7532866 Mon Sep 17 00:00:00 2001 From: Anatole-DC Date: Thu, 13 Jan 2022 18:01:22 +0100 Subject: [PATCH 5/6] :green_heart: Fix typo in cache var name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cfaa14c..26a4e8f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ jobs: steps: - checkout - restore_cache: - key: dependencies-{{ checksum "package.json" }}-v2 + key: dependencies-{{ checksum "package.json" }}-v1 - run: yarn lint - run: yarn format:check From 6578d79c98d867493733c47e1417436da69118b3 Mon Sep 17 00:00:00 2001 From: Anatole-DC Date: Thu, 13 Jan 2022 18:04:42 +0100 Subject: [PATCH 6/6] :construction_worker: Add unit testing Add unit testing step to ci --- .circleci/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26a4e8f..78c2fa4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,6 +25,17 @@ jobs: - 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 + workflows: version: 2 build-test-and-lint: @@ -32,4 +43,7 @@ workflows: - build - lint: requires : + - build + - back-test-unit: + requires: - build \ No newline at end of file