-
Notifications
You must be signed in to change notification settings - Fork 385
/
.travis.yml
57 lines (47 loc) · 1.89 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
language: generic
sudo: required
dist: trusty
services:
- docker
matrix:
fast_finish: true
include:
- os: linux
compiler: 'python3.6'
addons:
apt:
sources: ['deadsnakes']
packages: ['python3.6', 'python3.6-venv', 'libspatialindex-dev', 'libglib2.0-0']
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update && sudo apt-get -y install docker-ce
- sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 10
- python3 -m venv .env && . .env/bin/activate
- python3 -m pip install pip==19.1.1 pip-tools==3.7.0
- python3 -m piptools sync
- python3 -m pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl
- python3 -m pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl
script:
- python3 -m pytest
- python3 -m pip install flake8==3.5.0
- flake8 robosat
- python3 -m pip install black==18.6b4
- black . --exclude .env --check --line-length 120
after_success:
- |
if [[ $TRAVIS_BRANCH == "master" ]]; then
docker build -t mapbox/robosat:latest-cpu -f docker/Dockerfile.cpu .
docker build -t mapbox/robosat:latest-gpu -f docker/Dockerfile.gpu .
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker push mapbox/robosat:latest-cpu
docker push mapbox/robosat:latest-gpu
fi
- |
if [[ ! -z $TRAVIS_TAG ]]; then
docker build -t mapbox/robosat:$TRAVIS_TAG-cpu -f docker/Dockerfile.cpu .
docker build -t mapbox/robosat:$TRAVIS_TAG-gpu -f docker/Dockerfile.gpu .
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker push mapbox/robosat:$TRAVIS_TAG-cpu
docker push mapbox/robosat:$TRAVIS_TAG-gpu
fi