test.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Test
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - v*
  7. - dev-*
  8. paths:
  9. - "**/*.go"
  10. - "go.mod"
  11. - "go.sum"
  12. - ".github/workflows/test.yml"
  13. pull_request:
  14. types: [opened, synchronize, reopened]
  15. paths:
  16. - "**/*.go"
  17. - "go.mod"
  18. - "go.sum"
  19. - ".github/workflows/test.yml"
  20. jobs:
  21. test:
  22. runs-on: ${{ matrix.os }}
  23. strategy:
  24. fail-fast: false
  25. matrix:
  26. os: [windows-latest, ubuntu-latest, macos-latest]
  27. steps:
  28. - name: Set up Go 1.x
  29. uses: actions/setup-go@v2
  30. with:
  31. go-version: ^1.17
  32. - name: Checkout codebase
  33. uses: actions/checkout@v2
  34. with:
  35. fetch-depth: 0
  36. - name: Check Go modules
  37. run: |
  38. go mod tidy
  39. git diff --exit-code go.mod go.sum
  40. go mod verify
  41. - name: Test
  42. run: |
  43. export PATH=$(go env GOPATH)/bin:${PATH}
  44. go install -v github.com/ory/go-acc@latest
  45. go-acc --covermode=atomic -o=coverage.txt ./...
  46. shell: bash
  47. - name: Upload codecov
  48. run: bash <(curl -s https://codecov.io/bash)
  49. shell: bash