|
|
@ -8,19 +8,25 @@ on: |
|
|
|
- master |
|
|
|
- release/** |
|
|
|
|
|
|
|
permissions: |
|
|
|
contents: read |
|
|
|
|
|
|
|
jobs: |
|
|
|
tests: |
|
|
|
permissions: |
|
|
|
contents: read # for actions/checkout to fetch code |
|
|
|
pull-requests: read # for technote-space/get-diff-action to get git reference |
|
|
|
runs-on: ubuntu-latest |
|
|
|
strategy: |
|
|
|
fail-fast: false |
|
|
|
matrix: |
|
|
|
part: ["00", "01", "02", "03", "04", "05"] |
|
|
|
steps: |
|
|
|
- uses: actions/setup-go@v2 |
|
|
|
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2 |
|
|
|
with: |
|
|
|
go-version: "1.17" |
|
|
|
- uses: actions/checkout@v3 |
|
|
|
- uses: technote-space/get-diff-action@v6.0.1 |
|
|
|
- uses: actions/checkout@b0e28b5ac45a892f91e7d036f8200cf5ed489415 # v3 |
|
|
|
- uses: technote-space/get-diff-action@832a70d288f9623f9af054e9f5d8f52df7492c0a # v6.0.1 |
|
|
|
with: |
|
|
|
PATTERNS: | |
|
|
|
**/**.go |
|
|
@ -32,17 +38,20 @@ jobs: |
|
|
|
run: | |
|
|
|
make test-group-${{ matrix.part }} NUM_SPLIT=6 |
|
|
|
if: env.GIT_DIFF |
|
|
|
- uses: actions/upload-artifact@v2 |
|
|
|
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2 |
|
|
|
with: |
|
|
|
name: "${{ github.sha }}-${{ matrix.part }}-coverage" |
|
|
|
path: ./build/${{ matrix.part }}.profile.out |
|
|
|
|
|
|
|
upload-coverage-report: |
|
|
|
permissions: |
|
|
|
contents: read # for actions/checkout to fetch code |
|
|
|
pull-requests: read # for technote-space/get-diff-action to get git reference |
|
|
|
runs-on: ubuntu-latest |
|
|
|
needs: tests |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v3 |
|
|
|
- uses: technote-space/get-diff-action@v6.0.1 |
|
|
|
- uses: actions/checkout@b0e28b5ac45a892f91e7d036f8200cf5ed489415 # v3 |
|
|
|
- uses: technote-space/get-diff-action@832a70d288f9623f9af054e9f5d8f52df7492c0a # v6.0.1 |
|
|
|
with: |
|
|
|
PATTERNS: | |
|
|
|
**/**.go |
|
|
@ -50,26 +59,26 @@ jobs: |
|
|
|
go.mod |
|
|
|
go.sum |
|
|
|
Makefile |
|
|
|
- uses: actions/download-artifact@v2 |
|
|
|
- uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869 # v2 |
|
|
|
with: |
|
|
|
name: "${{ github.sha }}-00-coverage" |
|
|
|
if: env.GIT_DIFF |
|
|
|
- uses: actions/download-artifact@v2 |
|
|
|
- uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869 # v2 |
|
|
|
with: |
|
|
|
name: "${{ github.sha }}-01-coverage" |
|
|
|
if: env.GIT_DIFF |
|
|
|
- uses: actions/download-artifact@v2 |
|
|
|
- uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869 # v2 |
|
|
|
with: |
|
|
|
name: "${{ github.sha }}-02-coverage" |
|
|
|
if: env.GIT_DIFF |
|
|
|
- uses: actions/download-artifact@v2 |
|
|
|
- uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869 # v2 |
|
|
|
with: |
|
|
|
name: "${{ github.sha }}-03-coverage" |
|
|
|
if: env.GIT_DIFF |
|
|
|
- run: | |
|
|
|
cat ./*profile.out | grep -v "mode: set" >> coverage.txt |
|
|
|
if: env.GIT_DIFF |
|
|
|
- uses: codecov/codecov-action@v2.1.0 |
|
|
|
- uses: codecov/codecov-action@50ffd5fc58ed613b7848c7604df3a1effc13d659 # v2.1.0 |
|
|
|
with: |
|
|
|
file: ./coverage.txt |
|
|
|
if: env.GIT_DIFF |