version: 2
jobs:
  build:
    docker:
      - image: circleci/node:9.0.0
    steps:
      - checkout
      - run:   
          name: Install npm packages
          command: |
            npm install
      - run:   
          name: Install truffle and ganache-cli
          command: |
            sudo npm install -g truffle@4.0.1 && sudo npm install -g ganache-cli@6.0.3
      - run:   
          name: Run test-rpc
          background: true
          command: |
            ./rpcrun.bash 
      - run:
          name: Testing 
          command: |
            truffle test 
  