build-test.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. on:
  2. push:
  3. branches: [master]
  4. pull_request:
  5. # The branches below must be a subset of the branches above
  6. branches: [master]
  7. # for cache
  8. # checkout https://github.com/magnetikonline/action-golang-cache
  9. # https://www.lorenzobettini.it/2020/12/caching-dependencies-in-github-actions/
  10. # https://github.com/mongodb/mongocli/actions/runs/1637632940/workflow
  11. name: GO tests
  12. jobs:
  13. tests:
  14. strategy:
  15. matrix:
  16. go-version: [1.17]
  17. os: [ubuntu-latest, macos-latest, windows-latest]
  18. runs-on: ${{ matrix.os }}
  19. steps:
  20. - name: Checkout repository
  21. uses: actions/checkout@v2
  22. - name: Install Go
  23. uses: actions/setup-go@v2
  24. with:
  25. go-version: ${{ matrix.golang }}
  26. - name: Cache Dependencies
  27. uses: actions/cache@v2
  28. with:
  29. path: ~/go/pkg/mod # not sure if this part needs editing
  30. key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
  31. restore-keys: |
  32. ${{ runner.os }}-go-${{ matrix.golang }}-
  33. - name: Test
  34. # only test gss for now
  35. # go test ./... for all
  36. # after the testdata problems resolved
  37. # TODO: add makefile for testing
  38. run: go test ./internal/pkg/gss/