From 022b22426c0441b1bb1f090be1dd89f0fe5a115f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sun, 24 Aug 2025 00:49:04 +0200 Subject: [PATCH 1/2] Add coverage workflow --- .github/workflows/coverage.yaml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..2287544 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,37 @@ +name: coverage +on: + push: + tags: + - v* + branches: + - main + pull_request: + +jobs: + coverage: + name: Report Coverage + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: "1.24.x" + + - name: Check out code + uses: actions/checkout@v4 + + - name: Install deps + run: | + go mod download + + - name: Run tests with coverage output + run: | + go test -race -covermode atomic -coverprofile=covprofile ./... + + - name: Install goveralls + run: go install github.com/mattn/goveralls@latest + + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: goveralls -coverprofile=covprofile -service=github From 61c423a8d11f1761b6f92711fc3c024949179254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sun, 24 Aug 2025 00:52:10 +0200 Subject: [PATCH 2/2] Add code coverage badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2199b1f..ec5cf1d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # go-xerrors -[![Go Reference](https://pkg.go.dev/badge/github.com/mdobak/go-xerrors.svg)](https://pkg.go.dev/github.com/mdobak/go-xerrors) [![Go Report Card](https://goreportcard.com/badge/github.com/mdobak/go-xerrors)](https://goreportcard.com/report/github.com/mdobak/go-xerrors) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Go Reference](https://pkg.go.dev/badge/github.com/mdobak/go-xerrors.svg)](https://pkg.go.dev/github.com/mdobak/go-xerrors) [![Go Report Card](https://goreportcard.com/badge/github.com/mdobak/go-xerrors)](https://goreportcard.com/report/github.com/mdobak/go-xerrors) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Coverage Status](https://coveralls.io/repos/github/MDobak/go-xerrors/badge.svg?branch=coverage)](https://coveralls.io/github/MDobak/go-xerrors?branch=coverage) `go-xerrors` is a simple, idiomatic, lightweight Go package that provides utilities for error handling. It offers functions and types to support stack traces, multi-errors, and simplified panic handling. The package is compatible with Go's standard error handling mechanisms, such as `errors.As`, `errors.Is`, and `errors.Unwrap`, including features from Go 1.13 and 1.20.