test.yml 1.8 KB

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