You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

459 lines
15 KiB

[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
  1. version: 2.1
  2. executors:
  3. golang:
  4. docker:
  5. - image: tendermintdev/docker-tendermint-build
  6. working_directory: /go/src/github.com/tendermint/tendermint
  7. environment:
  8. GOBIN: /tmp/bin
  9. release:
  10. machine: true
  11. docs:
  12. docker:
  13. - image: tendermintdev/jq_curl
  14. environment:
  15. AWS_REGION: us-east-1
  16. commands:
  17. run_test:
  18. parameters:
  19. script_path:
  20. type: string
  21. steps:
  22. - attach_workspace:
  23. at: /tmp/bin
  24. - restore_cache:
  25. name: "Restore source code cache"
  26. keys:
  27. - go-src-v1-{{ .Revision }}
  28. - checkout
  29. - restore_cache:
  30. name: "Restore go modules cache"
  31. keys:
  32. - go-mod-v1-{{ checksum "go.sum" }}
  33. - run:
  34. name: "Running test"
  35. command: |
  36. bash << parameters.script_path >>
  37. jobs:
  38. setup_dependencies:
  39. executor: golang
  40. steps:
  41. - checkout
  42. - restore_cache:
  43. name: "Restore go modules cache"
  44. keys:
  45. - go-mod-v1-{{ checksum "go.sum" }}
  46. - run:
  47. command: |
  48. mkdir -p /tmp/bin
  49. - run:
  50. name: Cache go modules
  51. command: make go-mod-cache
  52. - run:
  53. name: tools
  54. command: make tools
  55. - run:
  56. name: "Build binaries"
  57. command: make install install_abci
  58. - save_cache:
  59. name: "Save go modules cache"
  60. key: go-mod-v1-{{ checksum "go.sum" }}
  61. paths:
  62. - "/go/pkg/mod"
  63. - save_cache:
  64. name: "Save source code cache"
  65. key: go-src-v1-{{ .Revision }}
  66. paths:
  67. - ".git"
  68. - persist_to_workspace:
  69. root: "/tmp/bin"
  70. paths:
  71. - "."
  72. test_abci_apps:
  73. executor: golang
  74. steps:
  75. - run_test:
  76. script_path: abci/tests/test_app/test.sh
  77. # if this test fails, fix it and update the docs at:
  78. # https://github.com/tendermint/tendermint/blob/develop/docs/abci-cli.md
  79. test_abci_cli:
  80. executor: golang
  81. steps:
  82. - run_test:
  83. script_path: abci/tests/test_cli/test.sh
  84. test_apps:
  85. executor: golang
  86. steps:
  87. - run_test:
  88. script_path: test/app/test.sh
  89. test_persistence:
  90. executor: golang
  91. steps:
  92. - run_test:
  93. script_path: test/persist/test_failure_indices.sh
  94. test_cover:
  95. executor: golang
  96. parallelism: 4
  97. steps:
  98. - restore_cache:
  99. name: "Restore source code cache"
  100. keys:
  101. - go-src-v1-{{ .Revision }}
  102. - checkout
  103. - restore_cache:
  104. name: "Restore go module cache"
  105. keys:
  106. - go-mod-v2-{{ checksum "go.sum" }}
  107. - run:
  108. name: "Run tests"
  109. command: |
  110. export VERSION="$(git describe --tags --long | sed 's/v\(.*\)/\1/')"
  111. export GO111MODULE=on
  112. mkdir -p /tmp/logs /tmp/workspace/profiles
  113. for pkg in $(go list github.com/tendermint/tendermint/... | circleci tests split --split-by=timings); do
  114. id=$(basename "$pkg")
  115. go test -v -timeout 5m -mod=readonly -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
  116. done
  117. - persist_to_workspace:
  118. root: /tmp/workspace
  119. paths:
  120. - "profiles/*"
  121. - store_artifacts:
  122. path: /tmp/logs
  123. localnet:
  124. working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
  125. machine:
  126. image: circleci/classic:latest
  127. environment:
  128. GOBIN: /home/circleci/.go_workspace/bin
  129. GOPATH: /home/circleci/.go_workspace/
  130. GOOS: linux
  131. GOARCH: amd64
  132. parallelism: 1
  133. steps:
  134. - checkout
  135. - run:
  136. name: run localnet and exit on failure
  137. command: |
  138. set -x
  139. docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux
  140. make localnet-start &
  141. ./scripts/localnet-blocks-test.sh 40 5 10 localhost
  142. test_p2p:
  143. environment:
  144. GOBIN: /home/circleci/.go_workspace/bin
  145. GOPATH: /home/circleci/.go_workspace
  146. machine:
  147. image: circleci/classic:latest
  148. steps:
  149. - checkout
  150. - run: mkdir -p $GOPATH/src/github.com/tendermint
  151. - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint
  152. - run: bash test/p2p/circleci.sh
  153. - store_artifacts:
  154. path: /home/circleci/project/test/p2p/logs
  155. upload_coverage:
  156. executor: golang
  157. steps:
  158. - attach_workspace:
  159. at: /tmp/workspace
  160. - restore_cache:
  161. name: "Restore source code cache"
  162. keys:
  163. - go-src-v1-{{ .Revision }}
  164. - checkout
  165. - restore_cache:
  166. name: "Restore go module cache"
  167. keys:
  168. - go-mod-v2-{{ checksum "go.sum" }}
  169. - run:
  170. name: gather
  171. command: |
  172. echo "mode: atomic" > coverage.txt
  173. for prof in $(ls /tmp/workspace/profiles/); do
  174. tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt
  175. done
  176. - run:
  177. name: upload
  178. command: bash .circleci/codecov.sh -f coverage.txt
  179. deploy_docs:
  180. executor: docs
  181. steps:
  182. - restore_cache:
  183. name: "Restore source code cache"
  184. keys:
  185. - go-src-v1-{{ .Revision }}
  186. - checkout
  187. - run:
  188. name: Trigger website build
  189. command: |
  190. curl --silent \
  191. --show-error \
  192. -X POST \
  193. --header "Content-Type: application/json" \
  194. -d "{\"branch\": \"$CIRCLE_BRANCH\"}" \
  195. "https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$WEBSITE_REPO_NAME/build?circle-token=$TENDERBOT_API_TOKEN" > response.json
  196. RESULT=`jq -r '.status' response.json`
  197. MESSAGE=`jq -r '.message' response.json`
  198. if [[ ${RESULT} == "null" ]] || [[ ${RESULT} -ne "200" ]]; then
  199. echo "CircleCI API call failed: $MESSAGE"
  200. exit 1
  201. else
  202. echo "Website build started"
  203. fi
  204. prepare_build:
  205. executor: golang
  206. steps:
  207. - restore_cache:
  208. name: "Restore source code cache"
  209. keys:
  210. - go-src-v1-{{ .Revision }}
  211. - checkout
  212. - run:
  213. name: Get next release number
  214. command: |
  215. export LAST_TAG="`git describe --tags --abbrev=0 --match "${CIRCLE_BRANCH}.*"`"
  216. echo "Last tag: ${LAST_TAG}"
  217. if [ -z "${LAST_TAG}" ]; then
  218. export LAST_TAG="${CIRCLE_BRANCH}"
  219. echo "Last tag not found. Possibly fresh branch or feature branch. Setting ${LAST_TAG} as tag."
  220. fi
  221. export NEXT_TAG="`python -u scripts/release_management/bump-semver.py --version "${LAST_TAG}"`"
  222. echo "Next tag: ${NEXT_TAG}"
  223. echo "export CIRCLE_TAG=\"${NEXT_TAG}\"" > release-version.source
  224. - run:
  225. name: Build dependencies
  226. command: make tools
  227. - persist_to_workspace:
  228. root: .
  229. paths:
  230. - "release-version.source"
  231. - save_cache:
  232. key: v2-release-deps-{{ checksum "go.sum" }}
  233. paths:
  234. - "/go/pkg/mod"
  235. build_artifacts:
  236. executor: golang
  237. parallelism: 4
  238. steps:
  239. - restore_cache:
  240. name: "Restore source code cache"
  241. keys:
  242. - go-src-v1-{{ .Revision }}
  243. - checkout
  244. - restore_cache:
  245. name: "Restore release dependencies cache"
  246. keys:
  247. - v2-release-deps-{{ checksum "go.sum" }}
  248. - attach_workspace:
  249. at: /tmp/workspace
  250. - run:
  251. name: Build artifact
  252. command: |
  253. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  254. source /tmp/workspace/release-version.source
  255. if test ${CIRCLE_NODE_INDEX:-0} == 0 ;then export GOOS=linux GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  256. if test ${CIRCLE_NODE_INDEX:-0} == 1 ;then export GOOS=darwin GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  257. if test ${CIRCLE_NODE_INDEX:-0} == 2 ;then export GOOS=windows GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  258. if test ${CIRCLE_NODE_INDEX:-0} == 3 ;then export GOOS=linux GOARCH=arm && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  259. - persist_to_workspace:
  260. root: build
  261. paths:
  262. - "*.zip"
  263. - "tendermint_linux_amd64"
  264. release_artifacts:
  265. executor: golang
  266. steps:
  267. - restore_cache:
  268. name: "Restore source code cache"
  269. keys:
  270. - go-src-v1-{{ .Revision }}
  271. - checkout
  272. - attach_workspace:
  273. at: /tmp/workspace
  274. - run:
  275. name: "Deploy to GitHub"
  276. command: |
  277. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  278. source /tmp/workspace/release-version.source
  279. echo "---"
  280. ls -la /tmp/workspace/*.zip
  281. echo "---"
  282. python -u scripts/release_management/sha-files.py
  283. echo "---"
  284. cat /tmp/workspace/SHA256SUMS
  285. echo "---"
  286. export RELEASE_ID="`python -u scripts/release_management/github-draft.py`"
  287. echo "Release ID: ${RELEASE_ID}"
  288. #Todo: Parallelize uploads
  289. export GOOS=linux GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  290. export GOOS=darwin GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  291. export GOOS=windows GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  292. export GOOS=linux GOARCH=arm && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  293. python -u scripts/release_management/github-upload.py --file "/tmp/workspace/SHA256SUMS" --id "${RELEASE_ID}"
  294. python -u scripts/release_management/github-publish.py --id "${RELEASE_ID}"
  295. release_docker:
  296. machine:
  297. image: ubuntu-1604:201903-01
  298. steps:
  299. - restore_cache:
  300. name: "Restore source code cache"
  301. keys:
  302. - go-src-v1-{{ .Revision }}
  303. - checkout
  304. - attach_workspace:
  305. at: /tmp/workspace
  306. - run:
  307. name: "Deploy to Docker Hub"
  308. command: |
  309. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  310. source /tmp/workspace/release-version.source
  311. cp /tmp/workspace/tendermint_linux_amd64 DOCKER/tendermint
  312. docker build --label="tendermint" --tag="tendermint/tendermint:${CIRCLE_TAG}" --tag="tendermint/tendermint:latest" "DOCKER"
  313. docker login -u "${DOCKERHUB_USER}" --password-stdin \<<< "${DOCKERHUB_PASS}"
  314. docker push "tendermint/tendermint"
  315. docker logout
  316. reproducible_builds:
  317. executor: golang
  318. steps:
  319. - attach_workspace:
  320. at: /tmp/workspace
  321. - restore_cache:
  322. name: "Restore source code cache"
  323. keys:
  324. - go-src-v1-{{ .Revision }}
  325. - checkout
  326. - setup_remote_docker:
  327. docker_layer_caching: true
  328. - run:
  329. name: Build tendermint
  330. no_output_timeout: 20m
  331. command: |
  332. sudo apt-get install -y ruby
  333. bash -x ./scripts/gitian-build.sh all
  334. for os in darwin linux windows; do
  335. cp gitian-build-${os}/result/tendermint-${os}-res.yml .
  336. cp gitian-build-${os}/build/out/tendermint-*.tar.gz .
  337. rm -rf gitian-build-${os}/
  338. done
  339. - store_artifacts:
  340. path: /go/src/github.com/tendermint/tendermint/tendermint-darwin-res.yml
  341. - store_artifacts:
  342. path: /go/src/github.com/tendermint/tendermint/tendermint-linux-res.yml
  343. - store_artifacts:
  344. path: /go/src/github.com/tendermint/tendermint/tendermint-windows-res.yml
  345. - store_artifacts:
  346. path: /go/src/github.com/tendermint/tendermint/tendermint-*.tar.gz
  347. # Test RPC implementation against the swagger documented specs
  348. contract_tests:
  349. working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
  350. machine:
  351. image: circleci/classic:latest
  352. environment:
  353. GOBIN: /home/circleci/.go_workspace/bin
  354. GOPATH: /home/circleci/.go_workspace/
  355. GOOS: linux
  356. GOARCH: amd64
  357. parallelism: 1
  358. steps:
  359. - checkout
  360. - run:
  361. name: Test RPC endpoints against swagger documentation
  362. command: |
  363. set -x
  364. export PATH=~/.local/bin:$PATH
  365. # install node and dredd
  366. ./scripts/get_nodejs.sh
  367. # build the binaries with a proper version of Go
  368. docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux build-contract-tests-hooks
  369. # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
  370. go get github.com/snikch/goodman/cmd/goodman
  371. make contract-tests
  372. workflows:
  373. version: 2
  374. test-suite:
  375. jobs:
  376. - deploy_docs:
  377. filters:
  378. branches:
  379. only:
  380. - master
  381. - setup_dependencies
  382. - test_abci_apps:
  383. requires:
  384. - setup_dependencies
  385. - test_abci_cli:
  386. requires:
  387. - setup_dependencies
  388. - test_apps:
  389. requires:
  390. - setup_dependencies
  391. - test_cover:
  392. requires:
  393. - setup_dependencies
  394. - test_persistence:
  395. requires:
  396. - setup_dependencies
  397. - localnet:
  398. requires:
  399. - setup_dependencies
  400. - test_p2p
  401. - upload_coverage:
  402. requires:
  403. - test_cover
  404. - reproducible_builds:
  405. filters:
  406. branches:
  407. only:
  408. - master
  409. - /v[0-9]+\.[0-9]+/
  410. - contract_tests:
  411. requires:
  412. - setup_dependencies
  413. release:
  414. jobs:
  415. - prepare_build
  416. - build_artifacts:
  417. requires:
  418. - prepare_build
  419. - release_artifacts:
  420. requires:
  421. - prepare_build
  422. - build_artifacts
  423. filters:
  424. branches:
  425. only:
  426. - /v[0-9]+\.[0-9]+/
  427. - release_docker:
  428. requires:
  429. - prepare_build
  430. - build_artifacts
  431. filters:
  432. branches:
  433. only:
  434. - /v[0-9]+\.[0-9]+/