build.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: Build
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. push:
  6. branches:
  7. - dev.v2
  8. - switch-to-gha # XXX
  9. jobs:
  10. # Run the full Tilt build and wait for it to converge
  11. tilt:
  12. runs-on: tilt-kube-public
  13. # Cancel previous builds on the same branch/ref. Full runs are expensive
  14. # and capacity is limited, so we want to avoid running multiple builds
  15. # in parallel even if it means skipping CI runs on permanent branches
  16. # (unfortunately, we can't differentiate between temporary and permanent
  17. # refs without duplicating the entire logic).
  18. concurrency:
  19. group: tilt-${{ github.ref }}
  20. cancel-in-progress: true
  21. steps:
  22. - uses: actions/checkout@v2
  23. - name: Expand for link to Tilt dashboard (only available during build)
  24. run: >
  25. echo "Tilt progress dashboard: https://$DASHBOARD_URL"
  26. - run: |
  27. kubectl config set-context ci --namespace=$DEPLOY_NS
  28. kubectl config use-context ci
  29. # TODO: Work around what is presumably a bug in the explorer Tilt code -
  30. # Buildpack won't pull the image itself on a cold cache
  31. # https://github.com/certusone/wormhole/issues/575
  32. - run: docker pull gcr.io/buildpacks/builder:v1
  33. - run: tilt ci -- --ci --namespace=$DEPLOY_NS --num=1
  34. timeout-minutes: 60
  35. # Clean up k8s resources
  36. - run: kubectl delete --namespace=$DEPLOY_NS service,statefulset,configmap,pod --all
  37. if: always()
  38. # Verify whether the Makefile builds the node (no dependencies other than Go)
  39. node:
  40. runs-on: ubuntu-20.04
  41. steps:
  42. - uses: actions/checkout@v2
  43. - uses: actions/setup-go@v2
  44. with:
  45. go-version: '1.17.5'
  46. - run: make node
  47. # Run linters. This is just Go and Protobuf for now, but could include things
  48. # like rustfmt as well.
  49. lint:
  50. # The linter is slow enough that we want to run it on the self-hosted runner
  51. runs-on: tilt-kube-public
  52. concurrency:
  53. group: tilt-${{ github.ref }}
  54. cancel-in-progress: true
  55. steps:
  56. - uses: actions/checkout@v2
  57. - uses: actions/setup-go@v2
  58. with:
  59. go-version: '1.17.5'
  60. - run: make generate && ./lint.sh