build-test.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: Build/Test
  2. on:
  3. push:
  4. branches:
  5. - develop
  6. pull_request:
  7. branches:
  8. - develop
  9. merge_group:
  10. types: [checks_requested]
  11. jobs:
  12. validate-protobuf:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v4
  16. with:
  17. path: ./
  18. -
  19. name: Install Go
  20. uses: actions/setup-go@v5
  21. with:
  22. go-version: 'stable'
  23. -
  24. name: Install protoc
  25. uses: arduino/setup-protoc@v3
  26. with:
  27. version: '25.3'
  28. -
  29. name: Install just
  30. uses: extractions/setup-just@v2
  31. - name: install protobuf-go
  32. run: |
  33. go install github.com/golang/protobuf/protoc-gen-go@latest
  34. go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
  35. which protoc-gen-go-grpc
  36. -
  37. name: Validate
  38. run: |
  39. just validate-protobuf
  40. backend:
  41. runs-on: ubuntu-latest
  42. steps:
  43. - uses: actions/checkout@v4
  44. with:
  45. path: ./
  46. -
  47. name: Install just
  48. uses: extractions/setup-just@v2
  49. -
  50. name: Install Go
  51. uses: actions/setup-go@v5
  52. with:
  53. go-version: 'stable'
  54. # Saves us from having to redownload all modules
  55. - name: Go Mod cache
  56. uses: actions/cache@v4
  57. with:
  58. path: |
  59. ~/.cache/go-build
  60. ~/go/pkg/mod
  61. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  62. -
  63. name: Test
  64. run: |
  65. just test
  66. -
  67. name: Build
  68. run: |
  69. just build-local
  70. - name: get-pr-info
  71. shell: bash
  72. env:
  73. PR_NUM: ${{ github.event.number }}
  74. run: |
  75. echo $PR_NUM > pr_num.txt
  76. echo $GITHUB_BASE_REF > base.txt
  77. echo $GITHUB_HEAD_REF > head.txt
  78. - name: Upload code coverage
  79. uses: actions/upload-artifact@v4
  80. with:
  81. name: code-coverage
  82. path: |
  83. coverage.out
  84. pr_num.txt
  85. base.txt
  86. head.txt