build-test.yaml 2.0 KB

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