Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): update coverage workflow #164

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
name: build
name: coverage

on:
workflow_call:
inputs:
go_version:
go-version:
required: false
type: string
default: stable
test_timeout:
go-version-file:
required: false
type: string
working-directory:
required: false
type: string
test-timeout:
required: false
type: string
default: 5m
secrets:
gh_pat:
required: false
codecov_token:
required: false

jobs:
coverage:
Expand All @@ -30,10 +38,17 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go_version }}
go-version: ${{ inputs.go-version }}
go-version-file: ${{ inputs.go-version-file }}
cache: true
- name: Download Go modules
run: go mod download
working-directory: ${{ inputs.working-directory }}
- name: Test
run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout ${{ inputs.test_timeout }}
run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout ${{ inputs.test-timeout }}
working-directory: ${{ inputs.working-directory }}
- uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
token: ${{ secrets.codecov_token }}
working-directory: ${{ inputs.working-directory }}