.travis.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Use the newer Travis-CI build templates based on the
  2. # Debian Linux distribution "Trusty" release.
  3. os: linux
  4. dist: trusty
  5. # Disable sudo for all builds by default. This ensures all jobs use
  6. # Travis-CI's containerized build environment unless specified otherwise.
  7. # The container builds have *much* shorter queue times than the VM-based
  8. # build environment on which the sudo builds depend.
  9. sudo: false
  10. services: false
  11. # Set the version of Go.
  12. language: go
  13. go: 1.11
  14. # Always set the project's Go import path to ensure that forked
  15. # builds get cloned to the correct location.
  16. go_import_path: github.com/vmware/govmomi
  17. # Ensure all the jobs know where the temp directory is.
  18. env:
  19. global: TMPDIR=/tmp
  20. jobs:
  21. include:
  22. # The "lint" stage runs the various linters against the project.
  23. - &lint-stage
  24. stage: lint
  25. env: LINTER=govet
  26. install: true
  27. script: make "${LINTER}"
  28. - <<: *lint-stage
  29. env: LINTER=goimports
  30. # The "build" stage verifies the program can be built against the
  31. # various GOOS and GOARCH combinations found in the Go releaser
  32. # config file, ".goreleaser.yml".
  33. - &build-stage
  34. stage: build
  35. env: GOOS=linux GOARCH=amd64
  36. install: true
  37. script: make install
  38. - <<: *build-stage
  39. env: GOOS=linux GOARCH=386
  40. - <<: *build-stage
  41. env: GOOS=darwin GOARCH=amd64
  42. - <<: *build-stage
  43. env: GOOS=darwin GOARCH=386
  44. - <<: *build-stage
  45. env: GOOS=freebsd GOARCH=amd64
  46. - <<: *build-stage
  47. env: GOOS=freebsd GOARCH=386
  48. - <<: *build-stage
  49. env: GOOS=windows GOARCH=amd64
  50. - <<: *build-stage
  51. env: GOOS=windows GOARCH=386
  52. # The test stage executes the test target.
  53. - stage: test
  54. install: true
  55. script: make test
  56. # The deploy stage deploys the build artifacts using goreleaser.
  57. #
  58. # This stage will only be activated when there is an annotated tag present
  59. # or when the text "/ci-deploy" is present in the commit message. However,
  60. # the "deploy" phase of the build will still only be executed on non-PR
  61. # builds as that restriction is baked into Travis-CI.
  62. #
  63. # Finally, this stage requires the Travis-CI VM infrastructure in order to
  64. # leverage Docker. This will increase the amount of time the jobs sit
  65. # in the queue, waiting to be built. However, it's a necessity as Travis-CI
  66. # only allows the use of Docker with VM builds.
  67. - stage: deploy
  68. if: tag IS present OR commit_message =~ /\/ci-deploy/
  69. sudo: required
  70. services: docker
  71. install: true
  72. script: make install
  73. after_success: docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
  74. deploy:
  75. - provider: script
  76. skip_cleanup: true
  77. script: curl -sL http://git.io/goreleaser | bash
  78. addons:
  79. apt:
  80. update: true
  81. packages: xmlstarlet