unit-test.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Unit Test
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - develop
  7. pull_request:
  8. branches:
  9. - master
  10. - develop
  11. # Allows you to run this workflow manually from the Actions tab
  12. workflow_dispatch:
  13. jobs:
  14. unit-test:
  15. strategy:
  16. matrix:
  17. go-version: [1.17.x]
  18. os: [ubuntu-18.04]
  19. runs-on: ${{ matrix.os }}
  20. steps:
  21. - name: Install Go
  22. uses: actions/setup-go@v2
  23. with:
  24. go-version: ${{ matrix.go-version }}
  25. - name: Checkout code
  26. uses: actions/checkout@v2
  27. - uses: actions/cache@v2
  28. with:
  29. # In order:
  30. # * Module download cache
  31. # * Build cache (Linux)
  32. # * Build cache (Mac)
  33. # * Build cache (Windows)
  34. path: |
  35. ~/go/pkg/mod
  36. ~/.cache/go-build
  37. ~/Library/Caches/go-build
  38. %LocalAppData%\go-build
  39. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  40. restore-keys: |
  41. ${{ runner.os }}-go-
  42. - name: Uint Test
  43. env:
  44. ANDROID_HOME: "" # Skip android test
  45. run: |
  46. go clean -testcache
  47. make test