accounts/.github/workflows/ragbench.yml
2025-08-13 11:10:04 +08:00

37 lines
931 B
YAML

name: RAG Benchmark
on:
pull_request:
push:
branches: [ main, 'release/**' ]
jobs:
bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with: { go-version: '1.22' }
- name: Run ragbench
env:
API_BASE: ${{ secrets.RAG_API_BASE }}
run: |
cd ragbench
if [ -n "${API_BASE}" ]; then API_FLAG="-api ${API_BASE}"; fi
go run ./cmd/ragbench ${API_FLAG} -in queries.yaml -out report.md
- name: Upload report artifact
uses: actions/upload-artifact@v4
with:
name: rag-benchmark-report
path: ragbench/report.md
if-no-files-found: error
- name: Comment report to PR
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
path: ragbench/report.md