Skip to content

Commit

Permalink
Merge pull request #88 from xataio/add-code-coverage
Browse files Browse the repository at this point in the history
Add code coverage to github actions
  • Loading branch information
eminano authored Nov 27, 2024
2 parents 8fe9ff7 + 0011423 commit 8ed50e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ jobs:
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
args: --timeout=30m --out-format=colored-line-number --config=.golangci.yml
coverage:
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
runs-on: ubuntu-latest
needs: test # Depends on the artifact uploaded by the "test" job
permissions:
contents: read
actions: read # to download code coverage results from "test" job
pull-requests: write # write permission needed to comment on PR
steps:
- uses: fgrosse/go-coverage-report@v1.2.0
with:
coverage-artifact-name: "code-coverage"
coverage-file-name: "coverage"
root-package: "pgstream"

license-check:
name: license check
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lint: ## Lint source code

.PHONY: test
test:
@go test -timeout 10m -race -cover -failfast ./...
@go test -coverprofile=coverage -timeout 10m -race -cover -failfast ./...

.PHONY: integration-test
integration-test:
Expand Down

0 comments on commit 8ed50e6

Please sign in to comment.