feat(http): 为 http engine 添加直接处理响应体的能力,并优化 openai sse 处理逻辑 #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CodeCov | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
strategy: | |
matrix: | |
go-version: [ '1.22', 'stable' ] | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:latest | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: testdb | |
MYSQL_USER: user | |
MYSQL_PASSWORD: password | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: --entrypoint redis-server | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
args: --config=.golangci.yaml --timeout=10m | |
- name: Test | |
run: go test -race -v ./... -coverprofile ./coverage.txt | |
env: | |
ENABLE_MYSQL_TEST: true | |
ENABLE_REDIS_TEST: true | |
REDIS_HOST: localhost | |
REDIS_PORT: 6379 | |
MYSQL_HOST: localhost | |
MYSQL_PORT: 3306 | |
MYSQL_USER: user | |
MYSQL_PASSWORD: password | |
MYSQL_DB: testdb | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: ./coverage.txt |