mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
feat(ci): enable go test in CI pipeline (#15750)
## What problem does this PR solve? Go test files are never compiled in CI — only production binaries via `go build`. This allowed a missing `"sort"` import in `metadata_filter_test.go` to be merged without detection. ## Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) ## Changes - Add `go test -count=1 ./internal/...` step after Go build in CI workflow - Fix missing `"sort"` import in `metadata_filter_test.go` (pre-existing compile error) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
19
.github/workflows/tests.yml
vendored
19
.github/workflows/tests.yml
vendored
@@ -141,6 +141,25 @@ jobs:
|
||||
sudo docker rm -f -v "${BUILDER_CONTAINER}"
|
||||
fi
|
||||
|
||||
- name: Prepare test resources
|
||||
run: |
|
||||
RESOURCE_REPO=https://github.com/infiniflow/resource.git
|
||||
RESOURCE_REF=549feaaf998954d65b668667f009125bc84a9c5e
|
||||
rm -rf /tmp/resource
|
||||
git clone "${RESOURCE_REPO}" /tmp/resource
|
||||
git -C /tmp/resource checkout "${RESOURCE_REF}"
|
||||
sudo mkdir -p /usr/share/infinity
|
||||
sudo ln -sf /tmp/resource /usr/share/infinity/resource
|
||||
mkdir -p resource
|
||||
ln -sf /tmp/resource/wordnet resource/wordnet
|
||||
|
||||
- name: Test Go packages
|
||||
run: |
|
||||
set -euo pipefail
|
||||
packages=$(go list ./internal/... | grep -vE '/storage(/|$)')
|
||||
CGO_ENABLED=1 GOPROXY=${GOPROXY:-https://goproxy.cn,https://proxy.golang.org,direct} \
|
||||
go test -count=1 ${packages}
|
||||
|
||||
- name: Build ragflow:nightly
|
||||
run: |
|
||||
RUNNER_WORKSPACE_PREFIX=${RUNNER_WORKSPACE_PREFIX:-${HOME}}
|
||||
|
||||
Reference in New Issue
Block a user