Skip to content

chore: modernize, optimize, and document the RDAP library #5

chore: modernize, optimize, and document the RDAP library

chore: modernize, optimize, and document the RDAP library #5

Workflow file for this run

name: Tests (Unit)
on:
pull_request:
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
jobs:
tests-unit:
name: Tests (Unit)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# 1.25.x is the floor declared in go.mod; 1.26.x is the latest release.
# Testing both ensures the declared minimum stays buildable while the
# latest toolchain is exercised.
go-version: ['1.25.x', '1.26.x']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Download dependencies
run: go mod download
- name: Run tests
run: |
go test -race -coverprofile=coverage.out ./...
coverage=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
echo "Total coverage: $coverage%"
if (( $(echo "$coverage < 50" | bc -l) )); then
echo "Coverage $coverage% is below 50% threshold"
exit 1
fi