JohannesHeidecke/irl-benchmark

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
  build:
    environment:
      CC_TEST_REPORTER_ID: 2f6930d1697c56cb95e14864f2e870f5a26a4b34d9b9933bcdc55a5164426750
    docker:
      # specify the version you desire here
      # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
      - image: circleci/python:3.6.1
      
      # 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/postgres:9.4

    working_directory: ~/irl-benchmark

    steps:
      - checkout

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

      - run:
          name: install dependencies
          command: |
            python3 -m venv venv
            . venv/bin/activate
            pip install --upgrade pip
            pip install numpy
            pip install -r requirements.txt
            pip install -e .
            pip install pytest
            pip install pytest-cov
      - save_cache:
          paths:
            - ./venv
          key: v1-dependencies-{{ checksum "requirements.txt" }}

      - run:
          name: run tests
          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
            . venv/bin/activate
            mkdir test-reports
            python setup.py test
            ./cc-test-reporter after-build -d -p ~/irl-benchmark --exit-code $?
      - store_test_results:
          path: htmlcov
      - store_artifacts:
          path: test-reports
          destination: test-reports