circle.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. version: 2
  2. jobs:
  3. build-ut:
  4. docker:
  5. - image: golang:1.13
  6. working_directory: /go/src/github.com/pingcap/parser
  7. steps:
  8. - checkout
  9. - run:
  10. name: "Verify parser.go is up-to-date"
  11. command: |
  12. mv parser.go parser.go.committed
  13. make parser
  14. diff -u parser.go.committed parser.go
  15. - run:
  16. name: "Check code format"
  17. command: make fmt
  18. - run:
  19. name: "Build & Test"
  20. command: make test
  21. - run:
  22. name: "Upload coverage"
  23. command: bash <(curl -s https://codecov.io/bash)
  24. build-integration:
  25. docker:
  26. - image: golang:1.13
  27. working_directory: /go/src/github.com/pingcap/parser
  28. steps:
  29. - checkout
  30. - run:
  31. name: "Integration Test"
  32. command: |
  33. cd /go/src/github.com/pingcap/
  34. git clone git@github.com:pingcap/tidb.git
  35. cd tidb
  36. rm go.sum
  37. GO111MODULE=on go mod edit -replace github.com/pingcap/parser=github.com/${CIRCLE_PR_USERNAME:-$CIRCLE_PROJECT_USERNAME}/${CIRCLE_PR_REPONAME:-$CIRCLE_PROJECT_REPONAME}@$CIRCLE_SHA1
  38. # use only 1 thread to minimize memory usage (we've only got 2 CPU + 4 GB on Circle CI).
  39. make gotest P=1
  40. workflows:
  41. version: 2
  42. build_and_test:
  43. jobs:
  44. - build-ut
  45. - build-integration