build.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. name: Build
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. push:
  6. branches:
  7. - dev.v2
  8. jobs:
  9. # Run the full Tilt build and wait for it to converge
  10. tilt:
  11. runs-on: tilt-kube-public
  12. # Cancel previous builds on the same branch/ref. Full runs are expensive
  13. # and capacity is limited, so we want to avoid running multiple builds
  14. # in parallel even if it means skipping CI runs on permanent branches
  15. # (unfortunately, we can't differentiate between temporary and permanent
  16. # refs without duplicating the entire logic).
  17. concurrency:
  18. group: ${{ github.workflow }}-tilt-${{ github.ref }}
  19. cancel-in-progress: true
  20. steps:
  21. - uses: actions/checkout@v2
  22. - name: Expand for link to Tilt dashboard (only available during build)
  23. run: >
  24. echo "Tilt progress dashboard: https://$DASHBOARD_URL"
  25. - run: |
  26. kubectl config set-context ci --namespace=$DEPLOY_NS
  27. kubectl config use-context ci
  28. - run: tilt ci -- --ci --namespace=$DEPLOY_NS --num=2
  29. timeout-minutes: 60
  30. # Clean up k8s resources
  31. - run: kubectl delete --namespace=$DEPLOY_NS service,statefulset,configmap,pod,job --all
  32. if: always()
  33. # Verify whether the Makefile builds the node (no dependencies other than Go)
  34. node:
  35. runs-on: ubuntu-20.04
  36. steps:
  37. - uses: actions/checkout@v2
  38. - uses: actions/setup-go@v2
  39. with:
  40. go-version: "1.17.5"
  41. - run: make node
  42. algorand:
  43. runs-on: ubuntu-20.04
  44. steps:
  45. - uses: actions/checkout@v3
  46. - uses: actions/setup-python@v3
  47. with:
  48. python-version: "3.10"
  49. - run: pip install -r algorand/requirements.txt
  50. - run: cd algorand && make test
  51. ethereum:
  52. runs-on: ubuntu-20.04
  53. steps:
  54. - uses: actions/checkout@v2
  55. - uses: actions/setup-node@v2
  56. with:
  57. node-version: "16"
  58. - run: cd ethereum && make test
  59. terra:
  60. runs-on: ubuntu-20.04
  61. steps:
  62. - uses: actions/checkout@v2
  63. - uses: actions/setup-node@v2
  64. with:
  65. node-version: "16"
  66. - run: cd terra && make test
  67. terra-2:
  68. runs-on: ubuntu-20.04
  69. steps:
  70. - uses: actions/checkout@v2
  71. - uses: actions/setup-node@v2
  72. with:
  73. node-version: "16"
  74. - run: cd cosmwasm && make test
  75. # Run linters, Go tests and other outside-of-Tilt things.
  76. lint-and-tests:
  77. # The linter is slow enough that we want to run it on the self-hosted runner
  78. runs-on: tilt-kube-public
  79. concurrency:
  80. group: ${{ github.workflow }}-lint-${{ github.ref }}
  81. cancel-in-progress: true
  82. steps:
  83. - uses: actions/checkout@v2
  84. - uses: actions/setup-go@v2
  85. with:
  86. go-version: "1.17.5"
  87. # ensure that code is formatted
  88. - run: GOFMT_OUTPUT="$(gofmt -l `find ./node ./event_database -name '*.go' | grep -v vendor` 2>&1)"; if [ -n "$GOFMT_OUTPUT" ]; then printf "All the following files are not correctly formatted\n${GOFMT_OUTPUT}\n"; exit 1; fi
  89. # run linters
  90. - run: make generate && ./lint.sh
  91. # The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols.
  92. - run: cd node && go test -v -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./...
  93. # Run rust lints and tests
  94. rust-lint-and-tests:
  95. runs-on: ubuntu-20.04
  96. strategy:
  97. matrix:
  98. manifest:
  99. - terra/Cargo.toml
  100. - sdk/rust/Cargo.toml
  101. steps:
  102. - name: Check out source
  103. uses: actions/checkout@v2
  104. - name: Install stable rust toolchain
  105. uses: actions-rs/toolchain@v1
  106. with:
  107. profile: minimal
  108. toolchain: stable
  109. default: true
  110. - name: Run `cargo check`
  111. uses: actions-rs/cargo@v1
  112. with:
  113. command: check
  114. args: --workspace --manifest-path ${{ matrix.manifest }}
  115. - name: Run `cargo test`
  116. uses: actions-rs/cargo@v1
  117. with:
  118. command: test
  119. args: --workspace --manifest-path ${{ matrix.manifest }}