Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
coverage:
range: 80..100
round: down
precision: 2

status:
project:
default:
enabled: yes
target: auto
if_not_found: success
if_ci_failed: error
ignore:
- tangopb/
- tangopb/tangopbmock/
- example/
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,31 @@ jobs:
echo "=== Test logs ==="
find . -name "test.log" -exec echo "--- {} ---" \; -exec cat {} \; || echo "No test logs found"

coverage:
name: Coverage
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version-file: go.mod

- name: Run tests with coverage
run: make cover

- name: Upload coverage to codecov.io
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6
with:
file: cover.out
verbose: true

dependencies:
name: Dependencies
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
Expand Down Expand Up @@ -199,6 +224,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- build-and-test
- coverage
- dependencies
- lint
- workflow-security
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ tools/gopackagesdriver.sh

# Built binaries
bin/

# Coverage output
cover.out
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build test proto gazelle clean clean-proto run-server run-client-get-graph run-client-changed-targets help
.PHONY: build cover test proto gazelle clean clean-proto run-server run-client-get-graph run-client-changed-targets help

# Bazel wrapper
BAZEL = ./tools/bazel
Expand Down Expand Up @@ -29,6 +29,12 @@ gazelle:
@$(BAZEL) run //:gazelle
@echo "BUILD files updated!"

# Run tests with coverage and generate cover.out
cover: ## Run tests with coverage
@echo "Running tests with coverage..."
@go test -race -coverprofile=cover.out -coverpkg=./... ./...
@echo "Coverage report written to cover.out"

# Clean generated files and binaries
clean:
@echo "Cleaning with Bazel..."
Expand Down
Loading