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:
@@ -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 }}
|
||||
Reference in New Issue
Block a user