From fab705ee4a3940ef236eb7cb4e5561daee71255d Mon Sep 17 00:00:00 2001 From: omrilotan Date: Wed, 30 Aug 2023 10:02:20 +0100 Subject: [PATCH 1/3] Update CI config --- .circleci/config.yml | 101 +++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 62 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e4b1375..62ed18f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,10 @@ defaults: &defaults working_directory: ~/app docker: - - image: circleci/node:12 + - image: cimg/node:18.17 + auth: + username: $DOCKER_USER + password: $DOCKER_PASS commands: runtests: @@ -23,65 +26,41 @@ jobs: - checkout - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - - run: - name: Install dependencies - command: npm i + - run: npm i - save_cache: key: dependency-cache-{{ checksum "package.json" }} paths: - ./node_modules - testnode12: - <<: *defaults - docker: - - image: circleci/node:12 - steps: - - runtests - testnode14: - <<: *defaults - docker: - - image: circleci/node:14 - steps: - - runtests - testnode16: - <<: *defaults - docker: - - image: circleci/node:16 - steps: - - runtests - testnode18: - <<: *defaults - docker: - - image: cimg/node:18.17.1 - steps: - - runtests - testnode20: - <<: *defaults - docker: - - image: cimg/node:20.5.1 - steps: - - runtests + - persist_to_workspace: + root: . + paths: + - ./node_modules test: <<: *defaults steps: - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package.json" }} - - run: - name: Run tests - command: npm t - lint: + - attach_workspace: + at: . + - run: npm t + - run: npm run lint -- --plugin log + compatibility: + parameters: + image: + description: "node version" + default: "lts" + type: string <<: *defaults + docker: + - image: "cimg/node:<>" + auth: + username: $DOCKER_USER + password: $DOCKER_PASS steps: - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package.json" }} - - run: - name: Check syntax - command: npm run lint -- --plugin log + - run: npm i + - run: npm t publish: <<: *defaults - docker: - - image: circleci/node:12 steps: - checkout - restore_cache: @@ -108,28 +87,26 @@ workflows: version: 2.1 ci-cd: jobs: - - install + - install: + context: org-global + - compatibility: + context: org-global + matrix: + parameters: + image: + - "14.21" + - "16.20" + # - "18.17" // default image + - "20.5" - test: + context: org-global requires: - install - - lint: - requires: - - install - - testnode12 - - testnode14 - - testnode16 - - testnode18 - - testnode20 - publish: context: org-global requires: - test - - lint - - testnode12 - - testnode14 - - testnode16 - - testnode18 - - testnode20 + - compatibility - glossary: context: org-global requires: From b6671dd6ba20554865c7209ac915d72f033389b9 Mon Sep 17 00:00:00 2001 From: omrilotan Date: Wed, 30 Aug 2023 11:23:14 +0100 Subject: [PATCH 2/3] Remove unused command --- .circleci/config.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62ed18f..a37df72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,18 +6,6 @@ defaults: &defaults username: $DOCKER_USER password: $DOCKER_PASS -commands: - runtests: - description: "Checkout, install dependencies, and run tests" - steps: - - checkout - - run: - name: Install dependencies - command: npm i - - run: - name: Run tests - command: npm t - version: 2.1 jobs: install: From a2d656623929b0a39e1db1c6ea1559ca81cf40d1 Mon Sep 17 00:00:00 2001 From: omrilotan Date: Thu, 31 Aug 2023 10:23:38 +0100 Subject: [PATCH 3/3] Test is compatability --- .circleci/config.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a37df72..8616caa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,15 +23,14 @@ jobs: root: . paths: - ./node_modules - test: + lint: <<: *defaults steps: - checkout - attach_workspace: at: . - - run: npm t - run: npm run lint -- --plugin log - compatibility: + test: parameters: image: description: "node version" @@ -77,16 +76,16 @@ workflows: jobs: - install: context: org-global - - compatibility: + - test: context: org-global matrix: parameters: image: - "14.21" - "16.20" - # - "18.17" // default image + - "18.17" - "20.5" - - test: + - lint: context: org-global requires: - install @@ -94,7 +93,7 @@ workflows: context: org-global requires: - test - - compatibility + - lint - glossary: context: org-global requires: