From 4481470d3d96bfb18662b1f0a68fae43e5f5c76e Mon Sep 17 00:00:00 2001 From: maoyifeng Date: Tue, 1 Sep 2026 14:56:19 +0800 Subject: [PATCH] CI : fix ci step ragflow_native_backend requires the following condition (#19086) CI : fix ci step ragflow_native_backend requires the following condition --- .github/workflows/sep-tests.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sep-tests.yml b/.github/workflows/sep-tests.yml index 372273f5e7..a32faca5a6 100644 --- a/.github/workflows/sep-tests.yml +++ b/.github/workflows/sep-tests.yml @@ -45,6 +45,7 @@ jobs: has_go_changes: ${{ steps.detect_changes.outputs.has_go_changes }} has_python_changes: ${{ steps.detect_changes.outputs.has_python_changes }} has_web_changes: ${{ steps.detect_changes.outputs.has_web_changes }} + has_native_deepdoc_changes: ${{ steps.detect_changes.outputs.has_native_deepdoc_changes }} api_proxy_schemes: ${{ steps.detect_changes.outputs.api_proxy_schemes }} steps: - name: Ensure workspace ownership @@ -179,11 +180,13 @@ jobs: has_go=false has_python=false has_web=false + has_native_deepdoc=false if [[ "${GITHUB_EVENT_NAME}" == "schedule" ]]; then has_go=true has_python=true has_web=true + has_native_deepdoc=true else if [[ "${GITHUB_EVENT_NAME}" == "pull_request" || "${GITHUB_EVENT_NAME}" == "pull_request_target" ]]; then CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}) @@ -199,9 +202,11 @@ jobs: while IFS= read -r file; do case "$file" in # Docker, test, SDK, and workflow changes can alter either server path. - Dockerfile|Dockerfile_ci|docker/**|.github/workflows/**|sdk/**) + # build.sh also controls the C++/native build, so it must trigger native backend. + Dockerfile|Dockerfile_ci|docker/**|.github/workflows/**|sdk/**|build.sh) has_go=true has_python=true + has_native_deepdoc=true ;; test/unit_test/**) has_python=true @@ -210,7 +215,14 @@ jobs: has_go=true has_python=true ;; - *.go|go.mod|go.sum|build.sh) has_go=true ;; + # DeepDoc native backend (Go inference layer, C++ static lib, pinned testdata). + # Must come BEFORE the generic "*.go"/"*.py" rules, otherwise deepdoc/*.go + # would be caught by "*.go" first and never set has_native_deepdoc. + internal/deepdoc/**|internal/binding/cpp/**|internal/deepdoc/native/testdata.ref) + has_go=true + has_native_deepdoc=true + ;; + *.go|go.mod|go.sum) has_go=true ;; *.py|pyproject.toml|requirements*.txt) has_python=true ;; web/*) has_web=true ;; esac @@ -220,6 +232,7 @@ jobs: has_go=true has_python=true has_web=true + has_native_deepdoc=true fi fi @@ -238,8 +251,9 @@ jobs: echo "has_go_changes=${has_go}" >> $GITHUB_OUTPUT echo "has_python_changes=${has_python}" >> $GITHUB_OUTPUT echo "has_web_changes=${has_web}" >> $GITHUB_OUTPUT + echo "has_native_deepdoc_changes=${has_native_deepdoc}" >> $GITHUB_OUTPUT echo "api_proxy_schemes=${api_proxy_schemes}" >> $GITHUB_OUTPUT - echo "Go: ${has_go}, Python: ${has_python}, Web: ${has_web}, proxy schemes: ${api_proxy_schemes}" + echo "Go: ${has_go}, Python: ${has_python}, Web: ${has_web}, Native DeepDoc: ${has_native_deepdoc}, proxy schemes: ${api_proxy_schemes}" - name: Prepare Python test environment if: steps.detect_changes.outputs.has_python_changes == 'true' @@ -1501,7 +1515,8 @@ jobs: # last also keeps a flaky -race OOM from ever obscuring the functional # verdict produced by the go jobs. needs: [ragflow_tests_infinity, ragflow_tests_elasticsearch] - if: ${{ github.event_name != 'pull_request' && github.event_name != 'pull_request_target' || (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'ci') && (github.event.action != 'labeled' || github.event.label.name == 'ci')) }} + # Skip unless DeepDoc native backend code/build/testdata actually changed. + if: ${{ (github.event_name != 'pull_request' && github.event_name != 'pull_request_target' || (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'ci') && (github.event.action != 'labeled' || github.event.label.name == 'ci'))) && needs.ragflow_preflight.outputs.has_native_deepdoc_changes == 'true' }} runs-on: [ "self-hosted", "ragflow-test" ] steps: - name: Ensure workspace ownership