version: 2
jobs:
  build:
    docker:
      - image: circleci/node:latest
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
      - run: yarn install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - run: yarn test
      - run: yarn deploy
      - run: ls -l build/* build.zip
      - run: sha256sum build/* build.zip | tee SHA256SUMS.txt
      - run: cat build/* | sha256sum | tee -a SHA256SUMS.txt
      - run: mkdir dist && mv build.zip SHA256SUMS.txt dist
      - store_artifacts:
          path: dist
          destination: dist

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:latest
    environment:
      CC_TEST_REPORTER_ID: $CC_TEST_REPORTER_ID
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
      - run: yarn install
      - run:
          name: Setup Code Climate test-reporter
          command: |
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            chmod +x ./cc-test-reporter
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - run: ./cc-test-reporter before-build
      - run: yarn test
      - run: ./cc-test-reporter after-build
      - run: yarn deploy
      - run: ls -l build/* build.zip
      - run: sha256sum build/* build.zip | tee SHA256SUMS.txt
      - run: cat build/* | sha256sum | tee -a SHA256SUMS.txt
      - run: mkdir dist && mv build.zip SHA256SUMS.txt dist
      - store_artifacts:
          path: dist
          destination: dist

Add Code Climate test coverage report
Add Code Climate test coverage report
