forked from rlworkgroup/garage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
111 lines (98 loc) · 2.92 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
105
106
107
108
109
110
111
language: python
python: "3.5"
services:
- docker
addons:
apt:
packages:
- docker-ce
env:
global:
- DOCKER_COMPOSE_VERSION=1.23.2
jobs:
include:
- stage: "Build"
name: "Build and cache docker container"
before_script: skip
install: skip
script:
- tag="rlworkgroup/garage-ci:${TRAVIS_BUILD_NUMBER}"
- make build-ci TAG="${tag}"
- make ci-deploy-docker TAG="${tag}"
- stage: test
# pre-commit checks only run for pull requests
if: type = pull_request
name: "Pre-commit checks"
env:
- JOB_RUN_CMD="make ci-job-precommit"
- name: "Normal tests"
env:
- JOB_RUN_CMD="make ci-job-normal"
- DEPLOY_FROM_THIS_JOB="true"
- name: "Large tests"
env: JOB_RUN_CMD="make ci-job-large"
- if: type != pull_request OR head_repo = "rlworkgroup/garage"
name: "MuJoCo-based tests"
env:
- JOB_RUN_CMD="make ci-job-mujoco"
- name: "Verify conda and pipenv installations"
env: JOB_RUN_CMD="make ci-job-verify-envs"
- if: type = cron
name: "Nightly tests"
env: JOB_RUN_CMD="make ci-job-nightly"
# special deploy stage for tag builds ONLY
- stage: deploy
if: tag IS present
name: "Deploy to PyPI"
before_install: skip
install: skip
script:
- echo "${TRAVIS_TAG}" > VERSION
after_script: skip
deploy:
provider: pypi
user: "__token__"
password: "${PYPI_TOKEN}"
skip_cleanup: true
on:
tags: true
before_install:
# Reconfigure docker to be more efficient
- |
echo '{
"experimental": true,
"storage-driver": "overlay2",
"max-concurrent-downloads": 50,
"max-concurrent-uploads": 50
}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart
# Reinstall docker compose with the specified version. For more information, see:
# https://docs.travis-ci.com/user/docker/#using-docker-compose
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
install:
# Pull cached docker image
- docker pull rlworkgroup/garage-ci:latest
- tag="rlworkgroup/garage-ci:${TRAVIS_BUILD_NUMBER}"
- make build-ci TAG="${tag}"
before_script:
- ci_env="$(bash <(curl -s https://codecov.io/env))"
script:
- make run-ci RUN_CMD="${JOB_RUN_CMD}" RUN_ARGS="${ci_env}" TAG="${tag}"
deploy:
provider: script
script: make ci-deploy-docker TAG="${tag}"
on:
branch: master
condition: $DEPLOY_FROM_THIS_JOB = true
git:
depth: false
branches:
only:
- master
- /release-.*/
- /^v([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.([0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$/ # regex for release tags
notifications:
email: false