Skip to content

Commit

Permalink
ci: update lint.yml workflow to include Taskfile.yml and improve Test…
Browse files Browse the repository at this point in the history
… coverage

- Add Taskfile.yml to the git diff
- Add `Install Task` step to the lint.yml workflow
- Remove `Go Coverage Badge` step from the lint.yml workflow
- Replace the `Test package` step in the lint.yml workflow with the `task coverage` step
- Update the `Update coverage report` step in the lint.yml workflow to include additional parameters

Signed-off-by: ysicing <[email protected]>
  • Loading branch information
ysicing committed Mar 20, 2024
1 parent 970b204 commit 0f7486d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,16 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- name: Install Task
uses: arduino/setup-task@v2
- name: Test package
run: |
go test -v ./... -coverprofile=coverage.txt -covermode count
go tool cover -func coverage.txt
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v2
task coverage
- name: Update coverage report
uses: ncruces/[email protected]
with:
filename: coverage.txt
report: 'true'
amend: 'true'
reuse-go: 'true'
continue-on-error: true
if: github.event_name == 'push'
5 changes: 3 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ tasks:

coverage:
desc: test package
dir: zentao
cmds:
- go test -v ./... -coverprofile=coverage.txt -covermode count
- go tool cover -func=coverage.txt
- go test -v ./... -coverprofile=../coverage.txt -covermode count
- go tool cover -func=../coverage.txt

gci:
cmds:
Expand Down

0 comments on commit 0f7486d

Please sign in to comment.