test.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.17
  20. uses: actions/setup-go@v2
  21. with:
  22. go-version: 1.17
  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.17-${{ hashFiles('**/go.sum') }}
  30. restore-keys: |
  31. ${{ runner.os }}-go1.17-
  32. - name: Build
  33. run: make all
  34. - name: Test
  35. run: make test
  36. - name: End 2 end
  37. run: make e2evv
  38. test:
  39. name: Build and test on ${{ matrix.os }}
  40. runs-on: ${{ matrix.os }}
  41. strategy:
  42. matrix:
  43. os: [windows-latest, macOS-latest]
  44. steps:
  45. - name: Set up Go 1.17
  46. uses: actions/setup-go@v2
  47. with:
  48. go-version: 1.17
  49. id: go
  50. - name: Check out code into the Go module directory
  51. uses: actions/checkout@v2
  52. - uses: actions/cache@v2
  53. with:
  54. path: ~/go/pkg/mod
  55. key: ${{ runner.os }}-go1.17-${{ hashFiles('**/go.sum') }}
  56. restore-keys: |
  57. ${{ runner.os }}-go1.17-
  58. - name: Build nebula
  59. run: go build ./cmd/nebula
  60. - name: Build nebula-cert
  61. run: go build ./cmd/nebula-cert
  62. - name: Test
  63. run: go test -v ./...
  64. - name: End 2 end
  65. run: make e2evv