diff --git a/.circleci/config.yml b/.circleci/config.yml index e4b1375..8616caa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,19 +1,10 @@ defaults: &defaults working_directory: ~/app docker: - - image: circleci/node:12 - -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 + - image: cimg/node:18.17 + auth: + username: $DOCKER_USER + password: $DOCKER_PASS version: 2.1 jobs: @@ -23,65 +14,40 @@ 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 - test: + - persist_to_workspace: + root: . + paths: + - ./node_modules + lint: <<: *defaults steps: - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package.json" }} - - run: - name: Run tests - command: npm t - lint: + - attach_workspace: + at: . + - run: npm run lint -- --plugin log + test: + 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 +74,26 @@ workflows: version: 2.1 ci-cd: jobs: - - install + - install: + context: org-global - test: - requires: - - install + context: org-global + matrix: + parameters: + image: + - "14.21" + - "16.20" + - "18.17" + - "20.5" - lint: + context: org-global requires: - install - - testnode12 - - testnode14 - - testnode16 - - testnode18 - - testnode20 - publish: context: org-global requires: - test - lint - - testnode12 - - testnode14 - - testnode16 - - testnode18 - - testnode20 - glossary: context: org-global requires: