From dfcf3e3df0b32b133b45cfa165fde96a802086f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Dejnek?= Date: Fri, 24 Oct 2025 21:45:57 +0200 Subject: [PATCH 1/3] feat: adds coverage badge workflow --- .github/workflows/go-coverage.yml | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/go-coverage.yml diff --git a/.github/workflows/go-coverage.yml b/.github/workflows/go-coverage.yml new file mode 100644 index 0000000..5816484 --- /dev/null +++ b/.github/workflows/go-coverage.yml @@ -0,0 +1,42 @@ +name: Coverage + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: '0' + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: 1.24 + cache: 'true' + + - name: Build + run: go install + + - name: Test + run: | + go test -v -cover ./... -coverprofile coverage.out -coverpkg ./... + go tool cover -func coverage.out -o coverage.out # Replaces coverage.out with the analysis of coverage.out + + - name: Go Coverage Badge + uses: tj-actions/coverage-badge-go@v3 + with: + green: 80 + filename: coverage.out + + - uses: stefanzweifel/git-auto-commit-action@v6 + id: auto-commit-action + with: + commit_message: Apply Code Coverage Badge + file_pattern: ./README.md From 8d39aeba05263dcefe06ab5dc25f04ba78623c0f Mon Sep 17 00:00:00 2001 From: IAmRadek <91426891+IAmRadek@users.noreply.github.com> Date: Fri, 24 Oct 2025 19:47:00 +0000 Subject: [PATCH 2/3] Apply Code Coverage Badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7f8fafe..d9a5e65 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # envconfig +![Coverage](https://img.shields.io/badge/Coverage-87.6%25-brightgreen) A small, dependency-free Go library for loading configuration from environment variables directly into your structs. From 11b23f7e16a99bbdf7aad606be3537fc2b0e1bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Dejnek?= Date: Fri, 24 Oct 2025 21:47:56 +0200 Subject: [PATCH 3/3] chore: readme --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d9a5e65..b13575d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # envconfig -![Coverage](https://img.shields.io/badge/Coverage-87.6%25-brightgreen) -A small, -dependency-free Go library for loading configuration from environment variables directly into your structs. [![Go Reference](https://pkg.go.dev/badge/github.com/struct0x/envconfig.svg)](https://pkg.go.dev/github.com/struct0x/envconfig) [![Go Report Card](https://goreportcard.com/badge/github.com/struct0x/envconfig)](https://goreportcard.com/report/github.com/struct0x/envconfig) +![Coverage](https://img.shields.io/badge/Coverage-87.6%25-brightgreen) + +A small, +dependency-free Go library for loading configuration from environment variables directly into your structs. It supports nested structs, prefixes, defaults, required fields, slices, maps, arrays, pointers, durations, and custom (un)marshalers.