From d1db7a31ac2444e3d39704f5d43592540b6f00c8 Mon Sep 17 00:00:00 2001 From: "Enot (ded) Skelly" Date: Tue, 9 Jun 2026 09:27:22 -0700 Subject: [PATCH] maint: add code coverage workflow --- .github/workflows/coverage.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..6297e17 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,33 @@ +# Copyright 2026 Beacon Contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +name: Test Coverage + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main ] + +jobs: + coverage: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 # Needed for PR diffs + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Install dependencies + run: go mod download + + - name: Run tests with coverage + run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./... + + - name: Display coverage + run: go tool cover -func=coverage.out