Skip to content
Merged
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
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.25'] # TODO: Test different versions

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }} # Use the version from the matrix
cache: true

- name: Verify dependencies
run: |
go mod download
go mod tidy
git diff --exit-code

- name: Build
run: go build -v ./...

- name: Vet
run: go vet ./...

- name: Run unit tests
run: go test -v ./...

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@2025.1.1

- name: Run staticcheck
run: $(go env GOPATH)/bin/staticcheck ./...

- name: Run tests with coverage
run: |
go test ./... -race -coverprofile=coverage.out -covermode=atomic

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.out
flags: unittests
fail_ci_if_error: true
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/arunksaha/gdsu.svg)](https://pkg.go.dev/github.com/arunksaha/gdsu)
[![Go Report Card](https://goreportcard.com/badge/github.com/arunksaha/gdsu)](https://goreportcard.com/report/github.com/arunksaha/gdsu)
![Build](https://github.com/arunksaha/gdsu/actions/workflows/ci.yml/badge.svg)



# gdsu — Generic Disjoint Set Union (Union-Find)

`gdsu` is a modern, type-safe, composable Disjoint Set Union (DSU) / Union-Find Go library.
Expand Down
Loading