Skip to content
Snippets Groups Projects
.travis.yml 1.11 KiB
Newer Older
  • Learn to ignore specific revisions
  • Todd Dembrey's avatar
    Todd Dembrey committed
    language: python
    python:
      - 3.6
    cache:
      pip: true
      directories:
        - node_modules
    
    # Use container-based infrastructure
    dist: trusty
    sudo: false
    
    # Services
    services:
      - postgresql
    
    addons:
      postgresql: "9.6"
    
    env:
      global:
    
        - DJANGO_SETTINGS_MODULE=opentech.settings.test
    
    Todd Dembrey's avatar
    Todd Dembrey committed
        - DATABASE_URL=postgres://postgres@localhost/test_db
    
    before_script:
      # Create a database
      - psql -c 'create database test_db;' -U postgres
    
    # Package installation
    install:
    
      - pip install codecov
    
    Todd Dembrey's avatar
    Todd Dembrey committed
      # Install project dependencies
      - pip install -r requirements.txt
    
    
      - nvm install 10
    
      # Install node dependencies
    
      # Install gulp-cli
      - npm install -g gulp-cli
    
      # Build the static files
      - gulp deploy
    
    Todd Dembrey's avatar
    Todd Dembrey committed
    # Run the tests
    script:
      # Run python code style checks
    
      - flake8 ./opentech
    
      # Collect static
      - python manage.py collectstatic --noinput --verbosity=0
    
    
    Todd Dembrey's avatar
    Todd Dembrey committed
      # Run system checks
      - python manage.py check
    
      # Check for missing migrations
    
      - python manage.py makemigrations --check --noinput --verbosity=0
    
    Todd Dembrey's avatar
    Todd Dembrey committed
    
      # Run tests
    
      - coverage run --source='.' manage.py test .
    
    
    after_success:
      codecov