test.yml 831 B

12345678910111213141516171819202122232425262728293031323334
  1. name: test
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. build:
  9. name: build
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: set up Go
  13. uses: actions/setup-go@v1
  14. with:
  15. go-version: 1.18
  16. id: go
  17. - name: set up Go module cache
  18. uses: actions/cache@v1
  19. with:
  20. path: ~/go/pkg/mod
  21. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  22. restore-keys: |
  23. ${{ runner.os }}-go-
  24. - name: setup env
  25. run: |
  26. echo "name=GOPATH::$(go env GOPATH)" >> $GITHUB_ENV
  27. echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
  28. shell: bash
  29. - name: check out code
  30. uses: actions/checkout@v2
  31. - name: install golint
  32. run: go install golang.org/x/lint/golint@latest
  33. - name: run tests
  34. run: make test