test.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. name: Build and test
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. paths:
  8. - '.github/workflows/test.yml'
  9. - '**Makefile'
  10. - '**.go'
  11. - '**.proto'
  12. - 'go.mod'
  13. - 'go.sum'
  14. jobs:
  15. test-linux:
  16. name: Build all and test on ubuntu-linux
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Set up Go 1.20
  20. uses: actions/setup-go@v2
  21. with:
  22. go-version: "1.20"
  23. id: go
  24. - name: Check out code into the Go module directory
  25. uses: actions/checkout@v2
  26. - uses: actions/cache@v2
  27. with:
  28. path: ~/go/pkg/mod
  29. key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
  30. restore-keys: |
  31. ${{ runner.os }}-go1.20-
  32. - name: Build
  33. run: make all
  34. - name: Vet
  35. run: make vet
  36. - name: Test
  37. run: make test
  38. - name: End 2 end
  39. run: make e2evv
  40. - uses: actions/upload-artifact@v3
  41. with:
  42. name: e2e packet flow
  43. path: e2e/mermaid/
  44. if-no-files-found: warn
  45. test-linux-boringcrypto:
  46. name: Build and test on linux with boringcrypto
  47. runs-on: ubuntu-latest
  48. steps:
  49. - name: Set up Go 1.20
  50. uses: actions/setup-go@v2
  51. with:
  52. go-version: "1.20"
  53. id: go
  54. - name: Check out code into the Go module directory
  55. uses: actions/checkout@v2
  56. - uses: actions/cache@v2
  57. with:
  58. path: ~/go/pkg/mod
  59. key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
  60. restore-keys: |
  61. ${{ runner.os }}-go1.20-
  62. - name: Build
  63. run: make bin-boringcrypto
  64. - name: Test
  65. run: make test-boringcrypto
  66. - name: End 2 end
  67. run: make e2evv GOEXPERIMENT=boringcrypto CGO_ENABLED=1
  68. test:
  69. name: Build and test on ${{ matrix.os }}
  70. runs-on: ${{ matrix.os }}
  71. strategy:
  72. matrix:
  73. os: [windows-latest, macos-11]
  74. steps:
  75. - name: Set up Go 1.20
  76. uses: actions/setup-go@v2
  77. with:
  78. go-version: "1.20"
  79. id: go
  80. - name: Check out code into the Go module directory
  81. uses: actions/checkout@v2
  82. - uses: actions/cache@v2
  83. with:
  84. path: ~/go/pkg/mod
  85. key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
  86. restore-keys: |
  87. ${{ runner.os }}-go1.20-
  88. - name: Build nebula
  89. run: go build ./cmd/nebula
  90. - name: Build nebula-cert
  91. run: go build ./cmd/nebula-cert
  92. - name: Vet
  93. run: make vet
  94. - name: Test
  95. run: make test
  96. - name: End 2 end
  97. run: make e2evv
  98. - uses: actions/upload-artifact@v3
  99. with:
  100. name: e2e packet flow
  101. path: e2e/mermaid/
  102. if-no-files-found: warn