You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

50 lines
1.3 KiB

  1. name: Tests
  2. on:
  3. push:
  4. branches: [master]
  5. pull_request:
  6. env:
  7. GOPROXY: "https://proxy.golang.org"
  8. jobs:
  9. lint:
  10. name: Lint
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Init Go modules
  15. run: go mod init gopkg.in/ini.v1
  16. - name: Run golangci-lint
  17. uses: actions-contrib/golangci-lint@v1
  18. test:
  19. name: Test
  20. strategy:
  21. matrix:
  22. go-version: [1.13.x, 1.14.x, 1.15.x]
  23. platform: [ubuntu-latest, macos-latest, windows-latest]
  24. runs-on: ${{ matrix.platform }}
  25. steps:
  26. - name: Install Go
  27. uses: actions/setup-go@v1
  28. with:
  29. go-version: ${{ matrix.go-version }}
  30. - name: Checkout code
  31. uses: actions/checkout@v2
  32. - name: Run unit tests
  33. run: |
  34. go mod init gopkg.in/ini.v1
  35. go test -v -race -coverprofile=coverage -covermode=atomic ./...
  36. - name: Upload coverage report to Codecov
  37. uses: codecov/codecov-action@v1.0.6
  38. with:
  39. file: ./coverage
  40. flags: unittests
  41. - name: Cache downloaded modules
  42. uses: actions/cache@v1
  43. with:
  44. path: ~/go/pkg/mod
  45. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  46. restore-keys: |
  47. ${{ runner.os }}-go-