Skip to content

Commit 1890639

Browse files
authored
Code coverage (#5)
* Add code coverage workflow * Add code coverage badge
1 parent e302f65 commit 1890639

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

.github/workflows/coverage.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: coverage
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
coverage:
12+
name: Report Coverage
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Install Go
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: "1.24.x"
19+
20+
- name: Check out code
21+
uses: actions/checkout@v4
22+
23+
- name: Install deps
24+
run: |
25+
go mod download
26+
27+
- name: Run tests with coverage output
28+
run: |
29+
go test -race -covermode atomic -coverprofile=covprofile ./...
30+
31+
- name: Install goveralls
32+
run: go install github.com/mattn/goveralls@latest
33+
34+
- name: Send coverage
35+
env:
36+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: goveralls -coverprofile=covprofile -service=github

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# go-xerrors
22

3-
[![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)
3+
[![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)
44

55
`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.
66

0 commit comments

Comments
 (0)