From 6bbf39de74bbe7437bca5369e9ac751fff8f4fb8 Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 3 Feb 2020 17:55:11 +0300 Subject: feat: configure circleCI :construction_worker: --- .circleci/config.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .circleci/config.yml (limited to '.circleci/config.yml') diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..76027f7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,29 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/node:12-stretch + + working_directory: ~/repo + + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: install NPM dependencies + command: npm install + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + - run: + name: Test code syntax with eslint + command: npx eslint . + -- cgit v1.2.3 From 856d9ad8038880f3f67ecfdf10d1b555563d0e3f Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 3 Feb 2020 21:35:47 +0300 Subject: fix: npm test in circleCI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.circleci/config.yml') diff --git a/.circleci/config.yml b/.circleci/config.yml index 76027f7..eb407a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,5 +25,5 @@ jobs: - run: name: Test code syntax with eslint - command: npx eslint . + command: npm test -- cgit v1.2.3 From 7b0e815ce93ab9a06e18c960fe357135b069349f Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 3 Feb 2020 22:15:55 +0300 Subject: feat: add deploy job to circleCI --- .circleci/config.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to '.circleci/config.yml') diff --git a/.circleci/config.yml b/.circleci/config.yml index eb407a4..49ed1ad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: - v1-dependencies- - run: - name: install NPM dependencies + name: Install NPM dependencies command: npm install - save_cache: @@ -24,6 +24,20 @@ jobs: key: v1-dependencies-{{ checksum "package.json" }} - run: - name: Test code syntax with eslint + name: Test syntax and perform type checking command: npm test + deploy: + requires: + - build + filters: + tags: + only: /^v.*/ + steps: + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc + - run: + name: Deploy package + command: npm run deploy + -- cgit v1.2.3 From d3dde3537fe88d5332277caef93f15d113c56256 Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 3 Feb 2020 22:20:27 +0300 Subject: fix: attach workspace to deploy job --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to '.circleci/config.yml') diff --git a/.circleci/config.yml b/.circleci/config.yml index 49ed1ad..7d74268 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,8 @@ jobs: tags: only: /^v.*/ steps: + - attach_workspace: + at: ~/repo - run: name: Authenticate with registry command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc -- cgit v1.2.3 From 9fe927e7eb7a001795100d251723ae138875a2d1 Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 3 Feb 2020 22:23:44 +0300 Subject: fix: add docker image version --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to '.circleci/config.yml') diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d74268..30202f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,6 +28,8 @@ jobs: command: npm test deploy: + docker: + - image: circleci/node:12-stretch requires: - build filters: -- cgit v1.2.3 From e0ab5995d6b6da1bb4ebd6a61f9e0fe755597587 Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 3 Feb 2020 22:53:42 +0300 Subject: ci: update configuration --- .circleci/config.yml | 54 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 14 deletions(-) (limited to '.circleci/config.yml') diff --git a/.circleci/config.yml b/.circleci/config.yml index 30202f5..84c6a35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,13 @@ version: 2 -jobs: - build: - docker: - - image: circleci/node:12-stretch - working_directory: ~/repo +defaults: &defaults + working_directory: ~/repo + docker: + - image: circleci/node:12-stretch +jobs: + checkout_and_test: + <<: *defaults steps: - checkout - restore_cache: @@ -28,16 +30,15 @@ jobs: command: npm test deploy: - docker: - - image: circleci/node:12-stretch - requires: - - build - filters: - tags: - only: /^v.*/ + <<: *defaults steps: - - attach_workspace: - at: ~/repo + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + - run: name: Authenticate with registry command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc @@ -45,3 +46,28 @@ jobs: name: Deploy package command: npm run deploy + +workflows: + version: 2 + + test: + jobs: + - checkout_and_test + + deploy: + jobs: + - checkout_and_test: + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ + - deploy: + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ + requires: + - checkout_and_test + -- cgit v1.2.3