test.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Integration Test
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. types: [opened, synchronize, reopened]
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout
  11. uses: actions/checkout@v3
  12. - name: Setup Go
  13. uses: actions/setup-go@v4
  14. with:
  15. go-version: 1.19
  16. - name: Build
  17. run: |
  18. env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build main.go
  19. env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags=ee main.go
  20. nmctl:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Checkout
  24. uses: actions/checkout@v3
  25. - name: Setup go
  26. uses: actions/setup-go@v4
  27. with:
  28. go-version: 1.19
  29. - name: Build
  30. run: |
  31. cd cli
  32. GOOS=linux GOARCH=amd64 go build -o nmctl
  33. GOOS=darwin GOARCH=amd64 go build -o nmctl
  34. GOOS=darwin GOARCH=arm64 go build -o nmctl
  35. GOOS=windows GOARCH=amd64 go build -o nmctl
  36. tests:
  37. runs-on: ubuntu-22.04
  38. steps:
  39. - name: Checkout
  40. uses: actions/checkout@v3
  41. - name: Setup Go
  42. uses: actions/setup-go@v4
  43. with:
  44. go-version: 1.19
  45. - name: run tests
  46. run: |
  47. go vet ./...
  48. go test -p 1 ./... -v
  49. go test -p 1 ./pro -v --tags ee
  50. env:
  51. DATABASE: sqlite
  52. CLIENT_MODE: "off"
  53. staticcheck:
  54. env:
  55. DATABASE: sqlite
  56. runs-on: ubuntu-22.04
  57. steps:
  58. - name: Checkout
  59. uses: actions/checkout@v3
  60. - name: Setup Go
  61. uses: actions/setup-go@v4
  62. with:
  63. go-version: 1.19
  64. - name: run static checks
  65. run: |
  66. sudo apt update
  67. go install honnef.co/go/tools/cmd/staticcheck@latest
  68. { ~/go/bin/staticcheck -tags=ee ./... ; }