chore(ci): remove GitHub Actions workflow files
💘 Generated with Crush
Assisted-by: mimo-v2.5 via Crush <crush@charm.land>
This commit is contained in:
parent
1e01d4829d
commit
c90dd10962
104
.github/workflows/benchmark.yml
vendored
104
.github/workflows/benchmark.yml
vendored
@ -1,104 +0,0 @@
|
|||||||
name: Benchmark
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- 'internal/**/*.go'
|
|
||||||
- 'go.mod'
|
|
||||||
- 'go.sum'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- 'internal/**/*.go'
|
|
||||||
- 'go.mod'
|
|
||||||
- 'go.sum'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
benchmark:
|
|
||||||
name: Run Benchmarks
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 30
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: 'go.mod'
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Install benchstat
|
|
||||||
run: go install golang.org/x/perf/cmd/benchstat@latest
|
|
||||||
|
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Fetch baseline benchmark
|
|
||||||
run: |
|
|
||||||
if git show origin/master:benchmark-baseline.txt >/dev/null 2>&1; then
|
|
||||||
git show origin/master:benchmark-baseline.txt > benchmark-baseline.txt
|
|
||||||
echo "baseline_found=true" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "baseline_found=false" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Run benchmarks
|
|
||||||
run: |
|
|
||||||
go test -bench=. -benchmem -count=10 ./... 2>&1 | tee benchmark-current.txt
|
|
||||||
|
|
||||||
- name: Compare benchmarks
|
|
||||||
if: env.baseline_found == 'true'
|
|
||||||
run: |
|
|
||||||
benchstat benchmark-baseline.txt benchmark-current.txt > benchmark-comparison.txt
|
|
||||||
cat benchmark-comparison.txt
|
|
||||||
|
|
||||||
- name: Check for regressions
|
|
||||||
if: env.baseline_found == 'true'
|
|
||||||
run: |
|
|
||||||
if command -v python3 >/dev/null 2>&1; then
|
|
||||||
benchstat benchmark-baseline.txt benchmark-current.txt | \
|
|
||||||
python3 scripts/check_regression.py - \
|
|
||||||
--config .benchmark-thresholds.yaml \
|
|
||||||
--environment ci \
|
|
||||||
|| echo "regression_detected=$?" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Python3 not available, skipping regression check"
|
|
||||||
fi
|
|
||||||
id: regression_check
|
|
||||||
|
|
||||||
- name: Save current benchmark as baseline
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
run: |
|
|
||||||
cp benchmark-current.txt benchmark-baseline.txt
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add benchmark-baseline.txt || true
|
|
||||||
git commit -m "chore(bench): update benchmark baseline" || true
|
|
||||||
git push || true
|
|
||||||
|
|
||||||
- name: Upload benchmark results
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: benchmark-results
|
|
||||||
path: |
|
|
||||||
benchmark-current.txt
|
|
||||||
benchmark-baseline.txt
|
|
||||||
benchmark-comparison.txt
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- name: Fail on regression
|
|
||||||
if: steps.regression_check.outputs.regression_detected == '2'
|
|
||||||
run: |
|
|
||||||
echo "::error::BLOCK level performance regression detected"
|
|
||||||
exit 2
|
|
||||||
119
.github/workflows/test.yml
vendored
119
.github/workflows/test.yml
vendored
@ -1,119 +0,0 @@
|
|||||||
name: Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [master]
|
|
||||||
pull_request:
|
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# L1 单元测试
|
|
||||||
unit:
|
|
||||||
name: Unit Tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.26'
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Run unit tests
|
|
||||||
run: make test
|
|
||||||
|
|
||||||
- name: Run linter
|
|
||||||
uses: golangci/golangci-lint-action@v7
|
|
||||||
with:
|
|
||||||
version: v2.11.4
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
# L2 集成测试(无需 Docker)
|
|
||||||
integration:
|
|
||||||
name: Integration Tests (L2)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.26'
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Run integration tests
|
|
||||||
run: make test-integration
|
|
||||||
|
|
||||||
# L3 E2E 测试(需要 Docker)
|
|
||||||
e2e:
|
|
||||||
name: E2E Tests (L3)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.26'
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Run E2E tests
|
|
||||||
run: make test-e2e
|
|
||||||
continue-on-error: true # E2E 测试可能因 Docker 限制失败
|
|
||||||
|
|
||||||
# 构建验证
|
|
||||||
build:
|
|
||||||
name: Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.26'
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: make build
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: lolly
|
|
||||||
path: bin/lolly
|
|
||||||
|
|
||||||
# 代码覆盖率
|
|
||||||
coverage:
|
|
||||||
name: Coverage
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.26'
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Generate coverage report
|
|
||||||
run: make test-cover
|
|
||||||
|
|
||||||
- name: Upload coverage
|
|
||||||
uses: codecov/codecov-action@v4
|
|
||||||
with:
|
|
||||||
files: ./coverage.out
|
|
||||||
fail_ci_if_error: false
|
|
||||||
Loading…
x
Reference in New Issue
Block a user