forked from alerta/alerta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
51 lines (41 loc) · 1.04 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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.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