uclouvain/osis-dissertation

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
env:
  global:
    - CC_TEST_REPORTER_ID=6a77439ce12ce968feae755e39a015a5e3597a361881c5c88d35eaf30bdceb6c
   

language: python
python: "3.5.5"
services:
  - postgresql
addons:
    postgresql: "9.6"
    apt:
      packages:
        - postgresql-9.6-postgis-2.4

install:
  - export PROJECT_DIR=`pwd`
  - cd /tmp
  - git clone https://github.com/uclouvain/osis.git
  - cd osis
  - git checkout $TRAVIS_BRANCH
  - git pull origin $TRAVIS_BRANCH
  - git submodule init
  - git submodule update
  - pip install -r requirements.txt
  - rm -Rf dissertation
  - ln -s $PROJECT_DIR dissertation

before_script:
  - cp .env.example .env
  - echo 'APPS_TO_TEST += ("dissertation",)' >> backoffice/settings/local.py
  - echo >> .env
  - echo "POSTGRES_USER = 'postgres'" >> .env
  - echo "POSTGRES_PASSWORD = ''" >> .env
  - psql -d template1 -c 'create extension unaccent;' -U postgres
  - psql -c 'create database osis_local;' -U postgres
  - 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

script:
  - python3 manage.py compilemessages && coverage run manage.py test dissertation --exclude-tag=selenium --no-logs

after_script:
  - coverage xml
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT