chore: add GitHub workflows for linting, testing, and release management

- Introduced dependabot configuration for Go modules and GitHub Actions.
- Added linting workflow to enforce code quality on pushes and pull requests.
- Created release workflow to automate versioning and releases based on tags.
- Implemented testing workflow to run tests across multiple Go versions and OS environments.
This commit is contained in:
2026-05-02 20:00:08 +01:00
parent 3b3ea59aa2
commit 43f4b2dc96
5 changed files with 195 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
name: Tests
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: Test (Go ${{ matrix.go }} / ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
go:
- "1.22"
- "1.23"
- "stable"
include:
- os: macos-latest
go: "stable"
- os: windows-latest
go: "stable"
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: Verify dependencies
run: |
go mod verify
go mod download
- name: Check go mod tidy
if: runner.os != 'Windows'
run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: Build
run: go build ./...
- name: Run tests with race detector and shuffle
run: go test -race -shuffle=on -count=1 -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.go == 'stable'
uses: codecov/codecov-action@v5
with:
files: ./coverage.out
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}