forked from mindsdb/mindsdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (92 loc) · 3.49 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
104
language: python
matrix:
include:
- name: "Python 3.7 on Ubuntu 16.0.4"
os: linux
python: 3.7
node: 11.15.0
dist: xenial
sudo: true
env:
DEPLOYMENT_ENV="true"
BADGE=linux
services:
- docker
- name: "Python 3.6 on Ubuntu 16.0.4"
os: linux
python: 3.6
node: 11.15.0
dist: xenial
- name: "Python 3.8 on Ubuntu 16.0.4"
os: linux
python: 3.8
node: 11.15.0
dist: xenial
- name: "Python 3.7.2 on OSX"
os: osx
language: shell
dist: xcode10.2
env:
BADGE=osx
- name: "Python 3.7.3 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version=3.7.3
- python -m pip install --upgrade pip
env:
PATH=/c/Python37:/c/Python37/Scripts:$PATH
BADGE=windows
notifications:
# send notifications only on master failure
email:
only: master
cache: pip
# install dependencies
install:
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then travis_wait 15 pip3 install --upgrade pip; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then travis_wait 15 pip install --no-cache-dir -e .; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then travis_wait 15 pip3 install --no-cache-dir -e .; fi
before_script: cd tests/ci_tests
# run tests
script:
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then travis_wait 15 python fast_test.py; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then travis_wait 15 python3 full_test.py; fi
- cd ../..
- pip install flake8
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
before_deploy:
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then cd docs/website/website; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then npm install; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then npm run build; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then cd ../../..; fi
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(.md)|^(.travis.yml)|^(LICENSE)'
then
echo "CI build skipped since only Docs were changed."
exit
fi
# deploy to pip and github pages
deploy:
- provider: pypi
user: "mindsdb_sysadmin"
password: $PYPI_SYSADMIN_PASSWORD
distributions: "sdist"
on:
branch: master
condition: $DEPLOYMENT_ENV = "true"
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: docs/website/website/build/mindsdb
on:
branch: master
condition: $DEPLOYMENT_ENV = "true"
# after pip is deployed, we can deploy to dockerhub
after_deploy:
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then sleep 15; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then cd distributions/docker; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then docker build -t docker-build .; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then docker tag docker-build $REGISTRY_USER/mindsdb:latest; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then cd ../..; fi
- if [[ "$DEPLOYMENT_ENV" = "true" && "$TRAVIS_BRANCH" = "master" ]]; then docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS" && docker push $REGISTRY_USER/mindsdb && docker logout; fi