-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enable GitHub actions for tests (#2953)
Summary: This commit adds a GitHub Actions workflow definition for our main CI build and tests. This new workflow will replace our use of Travis CI. GitHub Actions has much better latency, on the order of seconds instead of Travis’s minutes (usually) or hours (recently); better concurrency; comparable incremental build times; and notably faster (30%) clean build times. Travis is also turning down travis-ci.org in favor of travis-ci.com, which requires overly broad repository permissions, so we couldn’t continue with Travis even if we wanted to. Build artifacts are cached with [Bazel remote caching] talking to a GCS bucket, `gs://tensorboard-build-cache`. This bucket is publicly readable, so PRs from untrusted forks may freely read from it. Only trusted commits will be authorized to write to the build cache. Commits to master are always trusted, so most of the time, the cache should be fairly fresh. [Bazel remote caching]: https://docs.bazel.build/versions/master/remote-caching.html To proceed, we should merge this commit, make sure that its master build works, then make it required and make Travis not required. After a few days of soaking, disable Travis entirely. If something goes wrong, we can just roll back by making Travis required again. This does not yet have daily scheduled runs. Test Plan: Note that this commit triggers a GitHub Actions workflow that succeeds. wchargin-branch: gh-actions
- Loading branch information
Showing
6 changed files
with
128 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Limit resources since Travis Trusty GCE VMs have 2 cores and 7.5 GB RAM. | ||
build --local_cpu_resources=2 | ||
build --local_ram_resources=4000 | ||
build --worker_max_instances=2 | ||
|
||
# Ensure sandboxing is on to increase hermeticity. | ||
build --spawn_strategy=sandboxed | ||
build --worker_sandboxing | ||
|
||
# Ensure the PATH env var from our virtualenv propagates into tests, which is | ||
# no longer on by default in Bazel 0.21.0 and possibly again in the future. | ||
# We set this flag for "build" since "test" inherits it, but if we don't set | ||
# it for build too, this causes a rebuild at test time, and if we set it for | ||
# both we hit https://github.com/bazelbuild/bazel/issues/8237. | ||
# | ||
# See also: | ||
# https://github.com/bazelbuild/bazel/issues/7095 (protobuf PATH sensitivity) | ||
# https://github.com/bazelbuild/bazel/issues/7026 (future of action_env) | ||
build --action_env=PATH | ||
|
||
# Set up caching on local disk so incremental builds are faster. | ||
# See https://bazel.build/designs/2016/09/30/repository-cache.html | ||
build --repository_cache=~/.cache/tb-bazel-repo | ||
fetch --repository_cache=~/.cache/tb-bazel-repo | ||
query --repository_cache=~/.cache/tb-bazel-repo | ||
# See https://docs.bazel.build/versions/master/remote-caching.html#disk-cache | ||
build --disk_cache=~/.cache/tb-bazel-disk | ||
|
||
# Log more information to help with debugging, and disable curses output which | ||
# just adds more clutter to the log. (Travis spoofs an interactive terminal.) | ||
common --curses=no | ||
build --verbose_failures | ||
build --worker_verbose | ||
test --test_output=errors | ||
test --test_verbose_timeout_warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters