test.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.19
  20. uses: actions/setup-go@v2
  21. with:
  22. go-version: 1.19
  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.19-${{ hashFiles('**/go.sum') }}
  30. restore-keys: |
  31. ${{ runner.os }}-go1.19-
  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:
  46. name: Build and test on ${{ matrix.os }}
  47. runs-on: ${{ matrix.os }}
  48. strategy:
  49. matrix:
  50. os: [windows-latest, macos-11]
  51. steps:
  52. - name: Set up Go 1.19
  53. uses: actions/setup-go@v2
  54. with:
  55. go-version: 1.19
  56. id: go
  57. - name: Check out code into the Go module directory
  58. uses: actions/checkout@v2
  59. - uses: actions/cache@v2
  60. with:
  61. path: ~/go/pkg/mod
  62. key: ${{ runner.os }}-go1.19-${{ hashFiles('**/go.sum') }}
  63. restore-keys: |
  64. ${{ runner.os }}-go1.19-
  65. - name: Build nebula
  66. run: go build ./cmd/nebula
  67. - name: Build nebula-cert
  68. run: go build ./cmd/nebula-cert
  69. - name: Vet
  70. run: make vet
  71. - name: Test
  72. run: make test
  73. - name: End 2 end
  74. run: make e2evv
  75. - uses: actions/upload-artifact@v3
  76. with:
  77. name: e2e packet flow
  78. path: e2e/mermaid/
  79. if-no-files-found: warn