Skip to content

Instantly share code, notes, and snippets.

@grisu48
Forked from ryboe/.travis.yml
Created May 14, 2019 15:55
Show Gist options
  • Select an option

  • Save grisu48/251f71721380722cac0a9fa615a1e3d7 to your computer and use it in GitHub Desktop.

Select an option

Save grisu48/251f71721380722cac0a9fa615a1e3d7 to your computer and use it in GitHub Desktop.

Revisions

  1. @ryboe ryboe revised this gist Mar 31, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -9,8 +9,8 @@ env:
    - GO111MODULE=on
    - GOFLAGS='-mod vendor'

    # You don't need to test on very old version of the Go compiler. It's the user's
    # responsibility to keep their compilers up to date.
    # 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.12.x

  2. @ryboe ryboe revised this gist Mar 31, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion .travis.yml
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,8 @@ dist: xenial

    language: go

    # Force-enable Go modules. This will be unnecessary when Go 1.13 lands.
    # Force-enable Go modules. Also force go to use the code in vendor/
    # These will both be unnecessary when Go 1.13 lands.
    env:
    - GO111MODULE=on
    - GOFLAGS='-mod vendor'
  3. @ryboe ryboe revised this gist Mar 31, 2019. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,17 @@
    # This is a weird way of telling Travis to use the fast container-based test
    # runner instead of the slow VM-based runner.
    sudo: false
    # use the latest ubuntu environment (18.04) available on travis
    dist: xenial

    language: go

    # Force-enable Go modules. This will be unnecessary when Go 1.12 lands.
    # Force-enable Go modules. This will be unnecessary when Go 1.13 lands.
    env:
    - GO111MODULE=on
    - GOFLAGS='-mod vendor'

    # You don't need to test on very old version of the Go compiler. It's the user's
    # responsibility to keep their compilers up to date.
    go:
    - 1.11.x
    - 1.12.x

    # Only clone the most recent commit.
    git:
    @@ -29,7 +29,7 @@ notifications:
    # build and immediately stop. It's sorta like having set -e enabled in bash.
    # Make sure golangci-lint is vendored.
    before_script:
    - go install -mod vendor github.com/golangci/golangci-lint/cmd/golangci-lint
    - go install github.com/golangci/golangci-lint/cmd/golangci-lint

    # 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
  4. Ryan Boehning revised this gist Oct 19, 2018. 1 changed file with 9 additions and 10 deletions.
    19 changes: 9 additions & 10 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,14 @@ sudo: false

    language: go

    # Only the last two Go releases are supported by the Go team with security
    # updates. Any older versions be considered deprecated. Don't bother testing
    # with them.
    # Force-enable Go modules. This will be unnecessary when Go 1.12 lands.
    env:
    - GO111MODULE=on

    # You don't need to test on very old version of the Go compiler. It's the user's
    # responsibility to keep their compilers up to date.
    go:
    - 1.9.x
    - 1.x
    - 1.11.x

    # Only clone the most recent commit.
    git:
    @@ -25,12 +27,9 @@ notifications:

    # 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.
    # Make sure golangci-lint is vendored by running
    # dep ensure -add github.com/golangci/golangci-lint/cmd/golangci-lint
    # ...and adding this to your Gopkg.toml file.
    # required = ["github.com/golangci/golangci-lint/cmd/golangci-lint"]
    # Make sure golangci-lint is vendored.
    before_script:
    - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint
    - go install -mod vendor github.com/golangci/golangci-lint/cmd/golangci-lint

    # 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
  5. Ryan Boehning revised this gist May 28, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,10 @@ go:
    - 1.9.x
    - 1.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
  6. Ryan Boehning revised this gist May 28, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    # This is a weird way of telling Travis to use the fast container-based test
    # runner instead of the slow VM-based runner.
    sudo: false

    language: go

    # Only the last two Go releases are supported by the Go team with security
  7. Ryan Boehning revised this gist May 27, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,10 @@ notifications:

    # 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.
    # Make sure golangci-lint is vendored by running
    # dep ensure -add github.com/golangci/golangci-lint/cmd/golangci-lint
    # ...and adding this to your Gopkg.toml file.
    # required = ["github.com/golangci/golangci-lint/cmd/golangci-lint"]
    before_script:
    - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint

  8. Ryan Boehning revised this gist May 27, 2018. 1 changed file with 14 additions and 32 deletions.
    46 changes: 14 additions & 32 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -1,46 +1,28 @@
    language: go

    # Only the last two Go releases are supported by the Go team with security
    # updates. Any versions older than that should be considered deprecated.
    # Don't bother testing with them. tip builds your code with the latest
    # development version of Go. This can warn you that your code will break
    # in the next version of Go. Don't worry! Later we declare that test runs
    # are allowed to fail on Go tip.
    # updates. Any older versions be considered deprecated. Don't bother testing
    # with them.
    go:
    - 1.9
    - master
    - 1.9.x
    - 1.x

    # Skip the install step. Don't `go get` dependencies. Only build with the
    # code in vendor/
    # Skip the install step. Don't `go get` dependencies. Only build with the code
    # in vendor/
    install: true

    matrix:
    # It's ok if our code fails on unstable development versions of Go.
    allow_failures:
    - go: master
    # Don't wait for tip tests to finish. Mark the test run green if the
    # tests pass on the stable versions of Go.
    fast_finish: 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.
    # 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.
    before_script:
    - GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
    - go get github.com/golang/lint/golint # Linter
    - go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter
    - go get github.com/fzipp/gocyclo
    - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint

    # script always run to completion (set +e). All of these code checks are must haves
    # in a modern Go project.
    # 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:
    - test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
    - go test -v -race ./... # Run all the tests with the race detector enabled
    - go vet ./... # go vet is the official Go static analyzer
    - megacheck ./... # "go vet on steroids" + linter
    - gocyclo -over 19 $GO_FILES # forbid code with huge functions
    - golint -set_exit_status $(go list ./...) # one last linter
    - 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
  9. Ryan Boehning revised this gist Nov 26, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ language: go
    # are allowed to fail on Go tip.
    go:
    - 1.9
    - tip
    - master

    # Skip the install step. Don't `go get` dependencies. Only build with the
    # code in vendor/
    @@ -17,7 +17,7 @@ install: true
    matrix:
    # It's ok if our code fails on unstable development versions of Go.
    allow_failures:
    - go: tip
    - go: master
    # Don't wait for tip tests to finish. Mark the test run green if the
    # tests pass on the stable versions of Go.
    fast_finish: true
  10. Ryan Boehning revised this gist Oct 13, 2017. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,7 @@ language: go
    # in the next version of Go. Don't worry! Later we declare that test runs
    # are allowed to fail on Go tip.
    go:
    - 1.7
    - 1.8
    - 1.9
    - tip

    # Skip the install step. Don't `go get` dependencies. Only build with the
    @@ -27,20 +26,21 @@ matrix:
    notifications:
    email: false

    # Anything in before_script: that returns a nonzero exit code will
    # 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.
    before_script:
    - GO_FILES=$(find . -iname '*.go' | grep -v /vendor/) # All the .go files, excluding vendor/
    - PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/
    - go get github.com/golang/lint/golint # Linter
    - go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter
    - GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
    - go get github.com/golang/lint/golint # Linter
    - go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter
    - go get github.com/fzipp/gocyclo

    # script always run to completion (set +e). All of these code checks are must haves
    # in a modern Go project.
    script:
    - test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
    - go test -v -race $PKGS # Run all the tests with the race detector enabled
    - go vet $PKGS # go vet is the official Go static analyzer
    - megacheck $PKGS # "go vet on steroids" + linter
    - golint -set_exit_status $PKGS # one last linter
    - test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
    - go test -v -race ./... # Run all the tests with the race detector enabled
    - go vet ./... # go vet is the official Go static analyzer
    - megacheck ./... # "go vet on steroids" + linter
    - gocyclo -over 19 $GO_FILES # forbid code with huge functions
    - golint -set_exit_status $(go list ./...) # one last linter
  11. Ryan Boehning created this gist Jul 3, 2017.
    46 changes: 46 additions & 0 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    language: go

    # Only the last two Go releases are supported by the Go team with security
    # updates. Any versions older than that should be considered deprecated.
    # Don't bother testing with them. tip builds your code with the latest
    # development version of Go. This can warn you that your code will break
    # in the next version of Go. Don't worry! Later we declare that test runs
    # are allowed to fail on Go tip.
    go:
    - 1.7
    - 1.8
    - tip

    # Skip the install step. Don't `go get` dependencies. Only build with the
    # code in vendor/
    install: true

    matrix:
    # It's ok if our code fails on unstable development versions of Go.
    allow_failures:
    - go: tip
    # Don't wait for tip tests to finish. Mark the test run green if the
    # tests pass on the stable versions of Go.
    fast_finish: 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.
    before_script:
    - GO_FILES=$(find . -iname '*.go' | grep -v /vendor/) # All the .go files, excluding vendor/
    - PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/
    - go get github.com/golang/lint/golint # Linter
    - go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter

    # script always run to completion (set +e). All of these code checks are must haves
    # in a modern Go project.
    script:
    - test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
    - go test -v -race $PKGS # Run all the tests with the race detector enabled
    - go vet $PKGS # go vet is the official Go static analyzer
    - megacheck $PKGS # "go vet on steroids" + linter
    - golint -set_exit_status $PKGS # one last linter