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.

75 lines
1.9 KiB

  1. name: Test
  2. on:
  3. pull_request:
  4. push:
  5. paths:
  6. - "**.go"
  7. branches:
  8. - master
  9. - release/**
  10. jobs:
  11. tests:
  12. runs-on: ubuntu-latest
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. part: ["00", "01", "02", "03"]
  17. steps:
  18. - uses: actions/setup-go@v2
  19. with:
  20. go-version: "1.17"
  21. - uses: actions/checkout@v2.3.4
  22. - uses: technote-space/get-diff-action@v5
  23. with:
  24. PATTERNS: |
  25. **/**.go
  26. "!test/"
  27. go.mod
  28. go.sum
  29. Makefile
  30. - name: Run Go Tests
  31. run: |
  32. make test-group-${{ matrix.part }} NUM_SPLIT=4
  33. if: env.GIT_DIFF
  34. - uses: actions/upload-artifact@v2
  35. with:
  36. name: "${{ github.sha }}-${{ matrix.part }}-coverage"
  37. path: ./build/${{ matrix.part }}.profile.out
  38. upload-coverage-report:
  39. runs-on: ubuntu-latest
  40. needs: tests
  41. steps:
  42. - uses: actions/checkout@v2.4.0
  43. - uses: technote-space/get-diff-action@v5
  44. with:
  45. PATTERNS: |
  46. **/**.go
  47. "!test/"
  48. go.mod
  49. go.sum
  50. Makefile
  51. - uses: actions/download-artifact@v2
  52. with:
  53. name: "${{ github.sha }}-00-coverage"
  54. if: env.GIT_DIFF
  55. - uses: actions/download-artifact@v2
  56. with:
  57. name: "${{ github.sha }}-01-coverage"
  58. if: env.GIT_DIFF
  59. - uses: actions/download-artifact@v2
  60. with:
  61. name: "${{ github.sha }}-02-coverage"
  62. if: env.GIT_DIFF
  63. - uses: actions/download-artifact@v2
  64. with:
  65. name: "${{ github.sha }}-03-coverage"
  66. if: env.GIT_DIFF
  67. - run: |
  68. cat ./*profile.out | grep -v "mode: set" >> coverage.txt
  69. if: env.GIT_DIFF
  70. - uses: codecov/codecov-action@v2.1.0
  71. with:
  72. file: ./coverage.txt
  73. if: env.GIT_DIFF