mirror of
https://github.com/alerta/alerta.git
synced 2025-01-27 02:28:49 +00:00
51 lines
1 KiB
YAML
51 lines
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.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
|