2
0

build-test.yaml 2.0 KB

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