version: 2

jobs:
  build:
    macos:
      xcode: 8.3.3
    environment:
    - NODE_VERSION: "7.9.0"
    steps:
    - checkout
    - run:
        name: install llvm
        command: |
          brew update
          brew install llvm
          export PATH=${PATH}:/usr/local/opt/llvm/bin
    - run:
        name: install node.js with nvm
        command: |
          export NVM_DIR=${HOME}/.nvm
          curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
          [ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
          nvm install ${NODE_VERSION}
          nvm alias default ${NODE_VERSION}
          echo "[ -s \"${NVM_DIR}/nvm.sh\" ] && . \"${NVM_DIR}/nvm.sh\"" >> $BASH_ENV
    - run: npm install
    - run: npm run ci:circle
    - store_test_results:
        path: test-results
    - store_artifacts:
        path: test-results
    - run:
        name: lint js
        command: npm run lint:js
    - run:
        name: format c++
        command: npm run format && git diff --exit-code -- src/ test/
    - run:
        name: lint c++
        command: npm run lint:cpp

version: 2

jobs:
  build:
    macos:
      xcode: 8.3.3
    environment:
    - NODE_VERSION: "7.9.0"
    steps:
    - checkout
    - run:
        name: install llvm
        command: |
          brew update
          brew install llvm
          echo "export PATH=${PATH}:/usr/local/opt/llvm/bin" >> $BASH_ENV
    - run:
        name: install node.js with nvm
        command: |
          export NVM_DIR=${HOME}/.nvm
          curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
          [ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
          nvm install ${NODE_VERSION}
          nvm alias default ${NODE_VERSION}
          echo "[ -s \"${NVM_DIR}/nvm.sh\" ] && . \"${NVM_DIR}/nvm.sh\"" >> $BASH_ENV
    - run: npm install
    - run: npm run ci:circle
    - store_test_results:
        path: test-results
    - store_artifacts:
        path: test-results
    - run:
        name: lint js
        command: npm run lint:js
    - run:
        name: format c++
        command: npm run format && git diff --exit-code -- src/ test/
    - run:
        name: lint c++
        command: npm run lint:cpp

Put the PATH in ${BASH_ENV} too
Put the PATH in ${BASH_ENV} too
