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
77 changes: 0 additions & 77 deletions .github/workflows/build.yaml

This file was deleted.

103 changes: 103 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: [1.23.x]

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download

- name: Run tests
run: go test -v -race -coverprofile=coverage.out ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.out
fail_ci_if_error: false

lint:
name: Lint
runs-on: ubuntu-latest

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m

build:
name: Build
runs-on: ubuntu-latest
needs: [test, lint]

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Build (basic test)
run: go build -v .
87 changes: 87 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write

jobs:
test:
name: Test before release
runs-on: ubuntu-latest

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download

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

- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m

release:
name: Release
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-


- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Docker secrets removed

# Homebrew automation removed - manual tap updates are sufficient for local dev tool

# Release notifications removed - GitHub's built-in notifications are sufficient
120 changes: 120 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Configuration for golangci-lint
# https://golangci-lint.run/usage/configuration/

run:
timeout: 5m
go: "1.21"
modules-download-mode: readonly

# Settings for specific linters
linters-settings:
gofumpt:
# Choose whether to use the extra rules that are disabled by default
extra-rules: true

gocyclo:
# Minimal code complexity to report
min-complexity: 15

govet:
enable:
- shadow

misspell:
locale: US

gocritic:
enabled-tags:
- diagnostic
- style
- performance
- experimental
disabled-checks:
- whyNoLint
- wrapperFunc
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- hugeParam

revive:
rules:
- name: exported
disabled: false
- name: unexported-return
disabled: false
- name: unused-parameter
disabled: false

# Enable specific linters
linters:
enable:
- errcheck # Check for unchecked errors
- gosimple # Simplify code
- govet # Vet examines Go source code
- ineffassign # Detect ineffectual assignments
- staticcheck # Go static analysis
- typecheck # Parse and type-check Go code
- unused # Check for unused constants, variables, functions and types
- gofumpt # Stricter gofmt
- misspell # Correct commonly misspelled English words
- gocritic # Comprehensive Go source code linter
- gocyclo # Computes cyclomatic complexity
- unparam # Find unused function parameters
- revive # Replacement for golint
- goimports # Fix imports and format code
- gosec # Security-focused linter
- bodyclose # Check HTTP response body is closed
- nilerr # Check returning nil even if error is not nil
- rowserrcheck # Check SQL rows.Err is checked
- sqlclosecheck # Check SQL database/sql.Rows and sql.Stmt are closed
- unconvert # Remove unnecessary type conversions
- wastedassign # Find assignments to existing variables that are not used

disable: []

# Issues configuration
issues:
# Maximum count of issues with the same text. Set to 0 to disable.
max-same-issues: 50

# Maximum issues count per one linter. Set to 0 to disable.
max-issues-per-linter: 0

# Exclude following linters from requiring issues to be fixed
exclude-use-default: false

# List of regexps of issue texts to exclude
exclude:
# Allow shadowing of 'err' variable
- 'shadow: declaration of "err" shadows declaration'
# Allow unused parameters in interface implementations
- 'unused-parameter: parameter .* seems to be unused, consider removing or renaming it as _'

# Exclude specific issues by file patterns
exclude-rules:
# Exclude lll issues for long lines in test files
- path: _test\.go
linters:
- lll
- funlen
- gocognit
- gocyclo

# Exclude specific rules for generated files
- path: ".*\\.pb\\.go$"
linters:
- all

# Allow init functions in main package
- path: main\.go
text: "should not use init function"
linters:
- gochecknoinits

# Output configuration
output:
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true
Loading
Loading