Skip to content

Commit

Permalink
Updated unit test task to support coverage report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
prajwalv-netapp authored Jun 24, 2022
1 parent 655e707 commit cba4100
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,22 @@ jobs:
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go test ./...
${{ runner.os }}-go-
- name: Run the tests
run: |
go test -v ./... -covermode=count -coverprofile=${{ runner.os }}-coverage.out
- if: runner.os != 'Windows'
name: Prepare the artifact
run: |
go tool cover -html=${{ runner.os }}-coverage.out -o ${{ runner.os }}-coverage.html
- name: Get run details
run: |
echo "PR_Title=${{ github.event.pull_request.title }}"
echo "Run_Number=${{ github.run_number }}"
echo "PR_Number=${{ github.event.pull_request.number }}"
- if: runner.os != 'Windows'
name: Upload the artifact
uses: actions/upload-artifact@v2
with:
name: "coverage-report-${{ runner.os }}-${{ github.run_number }}.html"
path: ${{ runner.os }}-coverage.html

0 comments on commit cba4100

Please sign in to comment.