Skip to content

test: improve test coverage #69

test: improve test coverage

test: improve test coverage #69

Workflow file for this run

name: Test and coverage
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 2
- uses: actions/setup-go@v5.4.0
with:
go-version: '1.25'
- name: Run coverage
run: go env -w GOTOOLCHAIN=go1.25.0+auto && go test -coverpkg=./... ./... -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
integration:
runs-on: ubuntu-latest
services:
consul:
image: hashicorp/consul:latest
ports:
- 8500:8500
options: --health-cmd="consul members" --health-interval=2s --health-timeout=5s --health-retries=10
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.4.0
with:
go-version: '1.25'
- name: Run integration tests
run: go env -w GOTOOLCHAIN=go1.25.0+auto && go test -v -tags=integration -race ./...
env:
CONSUL_HTTP_ADDR: http://localhost:8500