0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-01-27 10:29:03 +00:00
alerta_alerta/.travis.yml
2020-06-10 22:01:28 +02:00

52 lines
1.1 KiB
YAML

if: tag IS present OR type = pull_request OR (branch = master AND type = push) # we only CI the master, tags and PRs
language: python
cache: pip
dist: xenial
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
env:
- DB=mongodb DATABASE_URL=mongodb://localhost:27017/alerta
- DB=postgres DATABASE_URL=postgres://localhost:5432/alerta
services:
- mongodb
- postgresql
addons:
postgresql: "10"
before_script:
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS alerta;' -U postgres; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'CREATE DATABASE alerta;' -U postgres; fi"
install:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install .
script:
- pytest --cov=alerta
stages:
- Hooks
- Checks
- Test
jobs:
include:
- stage: Hooks
name: Pre-commit
script: pre-commit run -a --show-diff-on-failure
- stage: Checks
name: Lint
script: pylint --rcfile pylintrc alerta
- name: Type Check
script: python -m mypy alerta/
after_success:
- coveralls