quentinrossetti/node-7z

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
# 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

    working_directory: ~/node-7z

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: 
          name: Install System Dependencies
          command: sudo apt-get update && sudo apt-get install -y p7zip-full
               
      - run:
          name: Install Package Dependencies
          command: npm install

      - run:
          name: Install Code Climate, notify of a pending test report
          command: |
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            chmod +x ./cc-test-reporter
            ./cc-test-reporter before-build

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      - run: 
          name: Run tests and coverage
          command: |
            set -e
            npm run test-coverage

      - store_artifacts:
          path: coverage/lcov.info

      - run:
          name: Send coverage to Code Climate
          command: ./cc-test-reporter after-build --coverage-input-type lcov --exit-code $?