Updated the GitHub CI workflow to use the correct golangci-lint installation path. Enhanced test mocks with proper mutex protection in TestMessageHandler and cleaned up FakeAgentSession implementation for better thread safety and performance. generated by llmgit Co-Authored-By: Claude <noreply@anthropic.com>
115 lines
2.5 KiB
YAML
115 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: true
|
|
|
|
- name: Lint code
|
|
run: |
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0
|
|
"$(go env GOPATH)/bin/golangci-lint" run ./...
|
|
|
|
- name: Lint GitHub workflows
|
|
run: |
|
|
go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.8
|
|
"$(go env GOPATH)/bin/actionlint" -color
|
|
|
|
unit-test:
|
|
runs-on: ubuntu-latest
|
|
needs: lint
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: true
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
env:
|
|
GOPROXY: https://proxy.golang.org,direct
|
|
GOSUMDB: sum.golang.org
|
|
|
|
- name: Build
|
|
run: go build ./...
|
|
|
|
- name: Run tests
|
|
run: go test ./... -v -race
|
|
|
|
- name: Run tests with coverage
|
|
run: go test ./... -coverprofile=coverage.out -covermode=atomic
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
if: github.event_name == 'push'
|
|
with:
|
|
files: ./coverage.out
|
|
fail_ci_if_error: false
|
|
|
|
smoke-test:
|
|
runs-on: ubuntu-latest
|
|
needs: unit-test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: true
|
|
|
|
- name: Run smoke tests
|
|
run: go test -v -tags=smoke ./tests/e2e/...
|
|
|
|
regression-test:
|
|
runs-on: ubuntu-latest
|
|
needs: smoke-test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: true
|
|
|
|
- name: Run regression tests
|
|
run: go test -v -tags=regression ./tests/e2e/...
|
|
|
|
performance-test:
|
|
runs-on: ubuntu-latest
|
|
needs: regression-test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: true
|
|
|
|
- name: Run performance benchmarks
|
|
run: go test -bench=. -benchmem -tags=performance ./tests/performance/...
|