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
2 changes: 1 addition & 1 deletion .github/workflows/bench-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 50
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: '1.24'
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends jq
- name: Run bench-diff
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Commit lint

on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
conventional-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate Conventional Commits style
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail

echo "Checking commits ${BASE_SHA}..${HEAD_SHA}"
# Allowed types — keep aligned with cliff.toml.
allowed='(feat|fix|perf|refactor|docs|test|ci|build|chore|src|style|revert)'
# Conventional Commits header:
# type(optional-scope)!: subject (>= 3 chars)
# The "!" marks a breaking change.
regex="^${allowed}(\([^)]+\))?(!)?: .{3,}"

bad_commits=()
while IFS= read -r commit; do
sha="${commit%% *}"
subject="${commit#* }"
if [[ ! "$subject" =~ $regex ]]; then
bad_commits+=("$sha — $subject")
fi
done < <(git log --no-merges --pretty=format:'%H %s' "$BASE_SHA".."$HEAD_SHA")

if (( ${#bad_commits[@]} > 0 )); then
echo
echo "::error::The following commits do not follow Conventional Commits:"
for c in "${bad_commits[@]}"; do
echo "::error:: $c"
done
echo
echo "Expected format: <type>(<scope>)?(!)?: <subject>"
echo "Allowed types: feat, fix, perf, refactor, docs, test, ci, build, chore, src, style, revert"
echo "Examples:"
echo " feat: add LeftJoinOn helper"
echo " fix(executor): skip nil tracer"
echo " refactor!: rename Repository.Tx to WithTx"
exit 1
fi

echo "All commits follow Conventional Commits."
16 changes: 14 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ on:

jobs:

lint:
runs-on: ubuntu-latest
name: golangci-lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24'
- uses: golangci/golangci-lint-action@v7
with:
version: v2.5.0

build:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.21', '1.22', '1.23' ]
go: [ '1.24' ]
name: Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v4
Expand All @@ -32,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.23' ]
go: [ '1.24' ]
name: Go ${{ matrix.go }} / Codecov
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: '1.24'
- run: go test -v -tags=integration ./tests/integration/...
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate release notes
id: cliff
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip header
env:
OUTPUT: RELEASE_NOTES.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body_path: ${{ steps.cliff.outputs.changelog }}
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
40 changes: 40 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: "2"

run:
timeout: 3m
build-tags:
- integration

linters:
default: none
enable:
- errcheck
- govet
- ineffassign
- misspell
- staticcheck
- unused
settings:
misspell:
locale: US
exclusions:
rules:
# Tests carry their own conventions and may shadow vars on purpose.
- path: _test\.go
linters:
- errcheck
- staticcheck
- ineffassign
- unused
# Quick-fix suggestions about embedded selectors are matters of taste.
- linters:
- staticcheck
text: "QF1008"

issues:
max-issues-per-linter: 0
max-same-issues: 0

formatters:
enable:
- gofmt
Loading
Loading