-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
103 lines (103 loc) · 3.3 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: ~> 1.0
# === setup ===
language: python
dist: xenial
os:
- linux
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
cache:
- pip
# includes PR when base branch = master
if: branch = master OR tag IS present
env:
global:
- secure: lzPPXuRTlqLHl2MCAUuy7ROrewSwPFGGKqbADo7npQ4jqVMAb/TQ5PTzIi4IAIvsv817dNj5WSAd39hsp1zSlE1R2jLtbxGEVqwcjTqSv9VStGascRQnCW1hcoSKYqESweEhtdIcH+uXpV8qnDsUWB6YIIP2VjgWPMfSPZPynFKC0IqZm2sFsqDEJJHr3QM5iN3i3Z9GrEIrBEEpoaf0yak5u8LjqoGSaY8ISPGWipBJYn7i/r/+sZpirFXbZRJmI4ljsaHi0tysNWdANOIf7S2+Dy/oGNn/3Br0OMJ5snFe/n6Uf4GcmPGDc1c86oN0FpGcoNSA+lCUPMASghOGwVqBhMjX+qAZZfzEbCGtr2j/MhcpETMO3S9oqelw4CcbZRXxP2Y20L+KGNOCSt3SC4/HdKj5MWRQGUnIZbT9C2Tpn2wTffpVRoKvhik/6UU8/KT12LSwDhjjrfqLgCEFLqH1nBL2Mopkj/eOwQbZ66nZmthrAF7/c+vaB38LWoqBIZi/fOwo6+kt947d1bW6UX6Z1KnCNLN2KO064Hjn+SHb1gAes0JIXIZE7af1Gti2dKmUL4a5eoYyU5vCLlp2nq5yxEtTUdJKZ1UVnkDqRtSaT0F3FgLypbFqi+qZ6AtygxKqplMjeAGhvVSqZTPqRupP1ac/KBBCvMzG8pkfXWs=
jobs:
- TEST_TARGET=test-local START_TARGET=
- TEST_TARGET=test-remote START_TARGET=start
addons:
postgresql: "9.6"
services:
- postgresql
postgres:
adapter: postgresql
database: magpie
username: postgres
password: qwerty
notifications:
email: false
# === pipeline ===
before_install:
# obtain details about environment
- python -V
- uname -a
- lsb_release -a
- hash -r
# fake conda paths to employ preinstalled virtualenv python
- export CONDA_ENV_NAME=python${TRAVIS_PYTHON_VERSION}
- export CONDA_ENVS_DIR=${HOME}/virtualenv
- export CONDA_PREFIX=${CONDA_ENVS_DIR}/${CONDA_ENV_NAME}
- export CONDA_ENV_PATH=${CONDA_PREFIX}
- env | sort
- make info
- make install-sys
# load magpie env and constants
- mkdir -p ./env
- cp -f ./ci/magpie.env ./env/magpie.env
install:
- make install-pkg install-dev
- make version
- ${CONDA_PREFIX}/bin/pip freeze
before_script:
- psql -c 'create database magpie;' -U postgres
- echo ${CONDA_PREFIX}
- echo ${CONDA_ENV}
- source ./env/magpie.env
- hash -r
- env | sort
stages:
- check # run linting checks and don't bother with the rest if invalid
- test # use default stage to run job matrix variations
- smoke-test # try running the built/packaged docker image
jobs:
allow_failures:
# leave versions while they remains easy to maintain
- python: "2.7" # deprecated support (January 2020)
- python: "3.5" # deprecated support (September 2020)
include:
# use stages to quick fail faster tests
# these are extra to default 'test' stage with auto-matrix/env extension
- stage: check
name: "Linter Checks"
python: "3.7"
os: linux
script: make check
- stage: check
name: "Documentation Check" # verify that build works
python: "3.7"
os: linux
script: make docs
- stage: test
name: "Coverage"
python: "3.7"
os: linux
script: make coverage
- stage: smoke-test
name: "Smoke Test"
python: "3.7"
os: linux
script: make test-docker
script:
# unit/functional tests (start as needed)
- make stop ${START_TARGET}
- make ${TEST_TARGET}
- make stop
after_success:
# coverage report
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
- source ${VIRTUAL_ENV}/bin/activate && python-codacy-coverage -r reports/coverage.xml