Building a Go Project
What This Guide Covers
CI environment for Go Projects
Travis VMs are 64 bit and currently provide
- any tagged version of Go (via gvm)
- core GNU build toolchain (autotools, make), cmake, scons
Go projects on travis-ci.org assume you use Make or straight Go build tool by default.
Specifying a Go version to use
Travis CI uses gvm, so you can use any tagged version of Go or use
tip to get the latest version.
language: go go: - 1.0 - 1.1 - tip
Because there is no dominant convention in the community about dependency management, Travis CI uses
go get -d -v ./... && go build -v ./...
to build Go project's dependencies by default.
If you need to perform special tasks before your tests can run, override the
install: key in your
install: make get-deps
It is also possible to specify a list of operations, for example, to
go get remote dependencies:
install: - go get github.com/bmizerany/assert - go get github.com/mrb/hob
See general build configuration guide to learn more.
Default Test Script
Go projects on travis-ci.org assume that either Make or Go build tool are used by default. In case there is a Makefile in the repository root, the default command Travis CI will use to run your project test suite is
In case there is no Makefile, it will be
go test -v ./...
Projects that find this sufficient can use a very minimalistic .travis.yml file:
This can be overridden as described in the general build configuration guide. For example, to omit the
script: key in
.travis.yml like this:
script: go test ./...
To build by running Scons without arguments, use this: