test.yml 823 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.14
  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 get -u golang.org/x/lint/golint
  33. - name: run tests
  34. run: make test