.travis.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. sudo: false
  2. language: go
  3. go:
  4. - 1.7.x
  5. - 1.8.x
  6. # Install g++-4.8 to support std=c++11 for github.com/google/certificate-transparency/go/merkletree
  7. addons:
  8. apt:
  9. sources:
  10. - ubuntu-toolchain-r-test
  11. packages:
  12. - g++-4.8
  13. install:
  14. - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi
  15. # Used by the certdb tests
  16. services:
  17. - mysql
  18. - postgresql
  19. before_install:
  20. # CFSSL consists of multiple Go packages, which refer to each other by
  21. # their absolute GitHub path, e.g. github.com/cloudflare/crypto/pkcs11key.
  22. # That means, by default, if someone forks the repo and makes changes across
  23. # multiple packages within CFSSL, Travis won't pass for the branch on their
  24. # own repo. To fix that, we move the directory
  25. - mkdir -p $TRAVIS_BUILD_DIR $GOPATH/src/github.com/cloudflare
  26. - test ! -d $GOPATH/src/github.com/cloudflare/cfssl && mv $TRAVIS_BUILD_DIR $GOPATH/src/github.com/cloudflare/cfssl || true
  27. # Only build pull requests, pushes to the master branch, and branches
  28. # starting with `test-`. This is a convenient way to push branches to
  29. # your own fork of the repostiory to ensure Travis passes before submitting
  30. # a PR. For instance, you might run:
  31. # git push myremote branchname:test-branchname
  32. branches:
  33. only:
  34. - master
  35. - /^test-.*$/
  36. before_script:
  37. - go get golang.org/x/tools/cmd/goimports
  38. - go get github.com/onsi/gomega
  39. - go get github.com/onsi/ginkgo
  40. - go get -u github.com/golang/lint/golint
  41. - go get github.com/modocache/gover
  42. - go get -v github.com/GeertJohan/fgt
  43. - go get -u honnef.co/go/tools/cmd/staticcheck
  44. # Setup DBs + run migrations
  45. - go get bitbucket.org/liamstask/goose/cmd/goose
  46. - if [[ $(uname -s) == 'Linux' ]]; then
  47. psql -c 'create database certdb_development;' -U postgres;
  48. goose -path $GOPATH/src/github.com/cloudflare/cfssl/certdb/pg up;
  49. mysql -e 'create database certdb_development;' -u root;
  50. goose -path $GOPATH/src/github.com/cloudflare/cfssl/certdb/mysql up;
  51. fi
  52. script:
  53. - ./test.sh
  54. notifications:
  55. email:
  56. recipients:
  57. - nick@cloudflare.com
  58. - zi@cloudflare.com
  59. - kyle@cloudflare.com
  60. on_success: never
  61. on_failure: change
  62. env:
  63. global:
  64. - secure: "OmaaZ3jhU9VQ/0SYpenUJEfnmKy/MwExkefFRpDbkRSu/hTQpxxALAZV5WEHo7gxLRMRI0pytLo7w+lAd2FlX1CNcyY62MUicta/8P2twsxp+lR3v1bJ7dwk6qsDbO7Nvv3BKPCDQCHUkggbAEJaHEQGdLk4ursNEB1aGimuCEc="
  65. - GO15VENDOREXPERIMENT=1
  66. matrix:
  67. - BUILD_TAGS="postgresql mysql"
  68. matrix:
  69. include:
  70. - os: osx
  71. go: 1.8.1
  72. env: BUILD_TAGS=
  73. after_success:
  74. - bash <(curl -s https://codecov.io/bash) -f coverprofile.txt