forked from tensorflow/tensorboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
136 lines (126 loc) · 4.83 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
dist: trusty
language: python
python:
- "2.7"
- "3.6"
branches:
only:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
env:
# Keep this Bazel version in sync with the `versions.check` directive
# near the top of our WORKSPACE file.
#
# Grab the BAZEL_SHA256SUM from the Bazel releases page; e.g.:
# bazel-0.20.0-linux-x86_64.sha256
global:
- BAZEL=0.26.1
- BAZEL_SHA256SUM=6c50e142a0a405d3d8598050d6c1b3920c8cdb82a7ffca6fc067cb474275148f
matrix:
- TF_VERSION_ID=tf-nightly==1.15.0.dev20190816
- TF_VERSION_ID=tf-nightly-2.0-preview
- TF_VERSION_ID= # Do not install TensorFlow in this case
cache:
# Reuse the pip cache directory across build machines.
pip: true
# Cache directories for Bazel. See ci/bazelrc for details.
directories:
- $HOME/.cache/tb-bazel-repo
- $HOME/.cache/tb-bazel-disk
# Each bullet point is displayed in the Travis log as one collapsed line, which
# indicates how long it took. Travis will check the return code at the end. We
# can't use `set -e` in the YAML file since it might impact Travis internals.
# If inline scripts get too long, Travis surprisingly prints them twice.
before_install:
- elapsed() { TZ=UTC printf "Time %(%T)T %s\n" "$SECONDS" "$1"; }
- elapsed "before_install"
- ci/download_bazel.sh "${BAZEL}" "${BAZEL_SHA256SUM}" ~/bazel
- sudo mv ~/bazel /usr/local/bin/bazel
- cp ci/bazelrc ~/.bazelrc
- elapsed "before_install (done)"
install:
- elapsed "install"
# Older versions of Pip sometimes resolve specifiers like `tf-nightly`
# to versions other than the most recent(!).
- pip install -U pip
# Lint check deps.
- pip install flake8==3.7.8
- pip install yamllint==1.17.0
# TensorBoard deps.
- pip install futures==3.1.1
- pip install grpcio==1.6.3
- yarn install --ignore-engines
# Uninstall older Travis numpy to avoid upgrade-in-place issues.
- pip uninstall -y numpy
- |
# Install TensorFlow if requested
if [ -n "${TF_VERSION_ID}" ]; then
pip install -I "${TF_VERSION_ID}"
else
# Requirements typically found through TensorFlow.
pip install "absl-py>=0.7.0" \
&& pip install "numpy<2.0,>=1.14.5"
fi
- |
# On TF 1.x nightlies, downgrade estimator temporarily.
case "${TF_VERSION_ID}" in
tf-nightly|tf-nightly==*)
pip install tf-estimator-nightly==1.14.0.dev2019091701
;;
esac
# Deps for gfile S3 test.
- pip install boto3==1.9.86
- pip install moto==1.3.7
# Workaround for https://github.com/travis-ci/travis-ci/issues/7940
- sudo rm -f /etc/boto.cfg
- pip freeze # print installed distributions, for debugging purposes
- elapsed "install (done)"
before_script:
- elapsed "before_script"
# Do a fail-fast check for Python syntax errors or undefined names.
# See: http://flake8.pycqa.org/en/3.7.8/user/error-codes.html
# Use the comment '# noqa: <error code>' to suppress.
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Lint frontend code
- yarn lint
# Lint .yaml docs files. Use '# yamllint disable-line rule:foo' to suppress.
- yamllint -c docs/.yamllint docs docs/.yamllint
# Make sure that IPython notebooks have valid Markdown.
- tensorboard/tools/docs_list_format_test.sh
# Make sure we aren't accidentally including work-in-progress code.
- tensorboard/tools/do_not_submit_test.sh
# Make sure all necessary files have the license information.
- tensorboard/tools/license_test.sh
# Make sure that build URLs are valid.
- tensorboard/tools/mirror_urls_test.sh
# Make sure that files have no trailing whitespace.
- tensorboard/tools/whitespace_hygiene_test.py
- |
# Specify subset of tests to run depending on TF installation config.
# We condition the value of --test_tag_filters so that we can run the
# bazel test command unconditionally which produces nicer log output.
if [ -z "${TF_VERSION_ID}" ]; then
test_tag_filters=support_notf
else
test_tag_filters=
fi
- elapsed "before_script (done)"
# Commands in this section should only fail if it's our fault. Travis will
# categorize them as 'failed', rather than 'error' for other sections.
script:
- elapsed "script"
# Note: bazel test implies fetch+build, but this gives us timing.
- elapsed && bazel fetch //tensorboard/...
- elapsed && bazel build //tensorboard/...
- elapsed && bazel test //tensorboard/... --test_tag_filters="${test_tag_filters}"
- elapsed && bazel run //tensorboard/pip_package:test_pip_package -- --default-python-only --tf-version "${TF_VERSION_ID}"
# Run manual S3 test
- elapsed && bazel test //tensorboard/compat/tensorflow_stub:gfile_s3_test
- elapsed && bazel test //tensorboard/summary/writer:event_file_writer_s3_test
- elapsed "script (done)"
after_script:
# Bazel launches daemons unless --batch is used.
- elapsed "after_script"
- bazel shutdown
notifications:
email: false