workflows:
  version: 2.1
  node-multi-build:
    jobs:
      - node-v6
      - node-v8
      - node-v10

version: 2.1
jobs:
  node-base: &node-base
    working_directory: ~/solc-js
    docker:
      - image: circleci/node
    steps:
      - run:
          name: Versions
          command: npm version
      - checkout
      - restore_cache:
          key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
      - run:
          name: install-npm
          command: npm install
      - run:
          name: lint
          command: npm run lint
      - run:
          name: test
          command: npm run test
      - save_cache:
          key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
          paths:
            - ./node_modules

  node-v6:
    <<: *node-base
    docker:
      - image: circleci/node:6
  node-v8:
    <<: *node-base
    docker:
      - image: circleci/node:8
  node-v10:
    <<: *node-base
    docker:
      - image: circleci/node:10
