Last active
December 5, 2024 03:44
-
Star
(106)
You must be signed in to star a gist -
Fork
(22)
You must be signed in to fork a gist
-
-
Save ryboe/df2dab474520c4086926f672c52db139 to your computer and use it in GitHub Desktop.
Example .travis.yml for Golang
This file contains hidden or 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
# use the latest ubuntu environment (18.04) available on travis | |
dist: bionic | |
language: go | |
# You don't need to test on very old versions of the Go compiler. It's the user's | |
# responsibility to keep their compiler up to date. | |
go: | |
- 1.16.x | |
# Only clone the most recent commit. | |
git: | |
depth: 1 | |
# Skip the install step. Don't `go get` dependencies. Only build with the code | |
# in vendor/ | |
install: true | |
# Don't email me the results of the test runs. | |
notifications: | |
email: false | |
# Anything in before_script that returns a nonzero exit code will flunk the | |
# build and immediately stop. It's sorta like having set -e enabled in bash. | |
# We can download and extract the golangci-lint binary in one (long) command. | |
before_script: | |
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.37.1 | |
# script always runs to completion (set +e). If we have linter issues AND a | |
# failing test, we want to see both. Configure golangci-lint with a | |
# .golangci.yml file at the top level of your repo. | |
script: | |
- golangci-lint run # run a bunch of code checkers/linters in parallel | |
- go test -v -race ./... # Run all the tests with the race detector enabled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@akash355 The error message is pointing to a missing Rakefile, so I don't think that has anything to do with Go. Are you using Ruby in your project? This
.travis.yml
file is only for Go projects.I would debug this by inserting
ls
commands into your.travis.yml
at a point prior to the failure. It will show you what files are present on the Travis CI runner. Good luck!