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.production - DATABASE_URL=postgres://postgres@localhost/test_db - CFG_SECRET_KEY=iamnotsosecret - CFG_ALLOWED_HOSTS=localhost before_script: # Create a database - psql -c 'create database test_db;' -U postgres # Package installation install: - pip install codecov # Install project dependencies - pip install -r requirements.txt # Install node - nvm install 8 # Move into the static_src folder where we will compile the FE - cd ./opentech/static_src # Install node dependencies - npm install --quiet # Build the static files - npm run build:prod # Change back to the original folder - cd - # Run the tests script: # Run python code style checks - flake8 # Type check the project - mypy . # Run system checks - python manage.py check # Check for missing migrations - python manage.py makemigrations --check --noinput # Run tests - coverage run --source='.' manage.py test opentech after_success: codecov