-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy path.travis.yml
143 lines (132 loc) · 4 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
language: python
python: "3.6"
services:
- docker
addons:
apt:
packages:
- docker-ce
stages:
- name: "Build"
if: NOT fork
- name: "Check"
# pre-commit checks only run for pull requests
if: type = pull_request
- name: "Test"
- name: "Deploy"
# special deploy stage for tag builds ONLY
if: tag IS present
jobs:
fast_finish: true
include:
- name: "Build and cache docker container"
stage: "Build"
env:
- SKIP_FOR_DOCS_ONLY="true"
before_script: skip
install: skip
script:
# Skip building for PRs and pushes in which no deps change
# Nightlies and API builds still always build
- >
scripts/travisci/check_no_deps_changed.sh &&
(
[[ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]] ||
[[ "${TRAVIS_EVENT_TYPE}" == "push" ]]
) &&
travis_terminate 0 || true
- tag="rlworkgroup/garage-ci:${TRAVIS_BUILD_NUMBER}"
- make build-ci TAG="${tag}" BUILD_ARGS="--no-cache"
- make ci-deploy-docker TAG="${tag}"
- name: "Check pre-commit"
stage: "Check"
env:
- JOB_RUN_CMD="make ci-job-precommit"
- SKIP_FOR_DOCS_ONLY="false"
- name: "Normal tests"
stage: "Test"
env:
- JOB_RUN_CMD="make ci-job-normal"
- SKIP_FOR_DOCS_ONLY="true"
- name: "Large tests"
stage: "Test"
env:
- JOB_RUN_CMD="make ci-job-large"
- SKIP_FOR_DOCS_ONLY="true"
- name: "MuJoCo-based tests"
stage: "Test"
if: type != pull_request OR head_repo = "rlworkgroup/garage"
env:
- JOB_RUN_CMD="make ci-job-mujoco"
- SKIP_FOR_DOCS_ONLY="true"
- name: "MuJoCo-based long running tests"
stage: "Test"
if: type != pull_request OR head_repo = "rlworkgroup/garage"
env:
- JOB_RUN_CMD="make ci-job-mujoco-long"
- SKIP_FOR_DOCS_ONLY="true"
- name: "Nightly tests"
stage: "Test"
if: type = cron
env: JOB_RUN_CMD="make ci-job-nightly"
- name: "Verify conda and pipenv installations"
if: type = cron
stage: "Test"
env:
- JOB_RUN_CMD="make ci-job-verify-envs"
- SKIP_FOR_DOCS_ONLY="true"
- name: "Deploy to PyPI"
stage: "Deploy"
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:
# Skip the job for PRs and pushes with only documentation changes
# Nightlies and API builds always run the job
- >
scripts/travisci/check_docs_only.sh &&
(
[[ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]] ||
[[ "${TRAVIS_EVENT_TYPE}" == "push" ]]
) &&
[[ "${SKIP_FOR_DOCS_ONLY}" == "true" ]] &&
travis_terminate 0 || true
# Reconfigure docker to be more efficient
- 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 -o Dpkg::Options::="--force-confnew" install docker-ce
- |
echo '{
"experimental": true,
"storage-driver": "overlay2",
"max-concurrent-downloads": 50,
"max-concurrent-uploads": 50
}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart
- docker --version
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}"
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