# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
  build:
    docker:
      - image: circleci/node:latest
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/mongo:3.4.4

    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
            - v6-dependencies-{{ checksum "package.json" }}
            # fallback to using the latest cache if no exact match is found
            - v6-dependencies-

      - run: yarn install

      - save_cache:
          paths:
            - node_modules
          key: v5-dependencies-{{ checksum "package.json" }}

      - run: yarn bs
      # build, lint and test
      - run: yarn packages

      - run: sudo apt-get install -y lsof

      # - run: cd other-packages/e2e-tests && node index.js || true

      - store_test_results:
          path: /tmp/test-result
