version: 2
jobs:
  build:
    working_directory: ~/mern-starter # directory where steps will run
    docker: # run the steps with Docker
      - image: circleci/node:10.14
    steps:
      - checkout
      - run:
          name: update-npm
          command: 'sudo npm install -g npm@latest'
      - run:
          name: update-apt-get 
          command: 'sudo apt-get update'
      - run:
          name: install-xmlsec1
          command: 'sudo apt-get install xmlsec1'
      - restore_cache: # special step to restore the dependency cache 
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: install-deps
          command: npm install
      - save_cache: # special step to save the dependency cache
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./node_modules
      - run: # run tests with code coverage
          name: test-code-coverage
          command: npm run coverage
      - run: # run coveralls report
          name: test-report-coveralls
          command: npm run coveralls

version: 2
jobs:
  build:
    working_directory: ~/mern-starter # directory where steps will run
    docker: # run the steps with Docker
      - image: circleci/node:16.13
    steps:
      - checkout
      - run:
          name: update-npm
          command: 'sudo npm install -g npm@latest'
      - run:
          name: update-apt-get
          command: 'sudo apt-get update'
      - run:
          name: install-xmlsec1
          command: 'sudo apt-get install xmlsec1'
      - restore_cache: # special step to restore the dependency cache
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: install-deps
          command: npm install
      - save_cache: # special step to save the dependency cache
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./node_modules
      - run: # run tests with code coverage
          name: test-code-coverage
          command: npm run coverage
      - run: # run coveralls report
          name: test-report-coveralls
          command: npm run coveralls

Update nodejs to LTS version
ci: Update nodejs to LTS version
