version: 2
jobs:
  build:
    branches:
      ignore:
        - gh-pages
    docker:
      - image: "circleci/node:10.12.0"
    environment:
      COVERALLS_REPO_TOKEN: R36fd3HhyEEZ6hn5Mg6ysnP1XaSy4UcpL
    steps:
      - run:
          name: Installing global dependencies
          command: sudo npm install -g typescript rollup nyc coveralls
      - checkout
      - run:
          name: Installing ASN1.js
          command: npm install
      - run:
          name: Building tests
          command: npm run build:tests
      - run:
          name: Run tests
          command: npm test
      - run:
          name: Coveralls
          command: cat ./coverage/lcov.info | coveralls
      - store_artifacts:
          path: ./coverage/lcov.info
          destination: coverage