Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

ci: reduce main CI orchestration scheduling overhead (#43114)

Stephen Zhouce27ef9dc3c0
diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml
index d6cc9bf8c72..7e1e34967dd 100644
--- a/.github/workflows/main-ci.yml
+++ b/.github/workflows/main-ci.yml
@@ -21,9 +21,10 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'merge_group' }}
jobs:
+ # Keep orchestration independent of the Depot pool used for test execution.
pre_job:
name: Skip Duplicate Checks
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip || 'false' }}
steps:
@@ -37,7 +38,7 @@ jobs:
# Check which paths were changed to determine which tests to run
check-changes:
name: Check Changed Files
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
outputs:
api-changed: ${{ steps.changes.outputs.api }}
cli-changed: ${{ steps.changes.outputs.cli }}
@@ -215,7 +216,8 @@ jobs:
- '.editorconfig'
- '.vite-hooks/**'
- # Run tests in parallel while always emitting stable required checks.
+ # Finalizers report unchanged paths directly, avoiding separate skip-only jobs.
+ # Keep each required check name stable and fail closed if classification fails.
api-tests-run:
name: Run API Tests
needs:
@@ -225,17 +227,6 @@ jobs:
uses: ./.github/workflows/api-tests.yml
secrets: inherit
- api-tests-skip:
- name: Skip API Tests
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.api-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped API tests
- run: echo "No API-related changes detected; skipping API tests."
-
api-tests:
name: API Tests
if: ${{ always() }}
@@ -243,21 +234,26 @@ jobs:
- pre_job
- check-changes
- api-tests-run
- - api-tests-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize API Tests status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.api-changed }}
RUN_RESULT: ${{ needs.api-tests-run.result }}
- SKIP_RESULT: ${{ needs.api-tests-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "API tests were skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "API tests ran successfully."
@@ -268,12 +264,12 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "API tests were skipped because no API-related files changed."
exit 0
fi
- echo "API tests were not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1
cli-tests-run:
@@ -285,17 +281,6 @@ jobs:
uses: ./.github/workflows/cli-tests.yml
secrets: inherit
- cli-tests-skip:
- name: Skip CLI Tests
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.cli-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped CLI tests
- run: echo "No CLI-related changes detected; skipping CLI tests."
-
cli-tests:
name: CLI Tests
if: ${{ always() }}
@@ -303,21 +288,26 @@ jobs:
- pre_job
- check-changes
- cli-tests-run
- - cli-tests-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize CLI Tests status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.cli-changed }}
RUN_RESULT: ${{ needs.cli-tests-run.result }}
- SKIP_RESULT: ${{ needs.cli-tests-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "CLI tests were skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "CLI tests ran successfully."
@@ -328,12 +318,12 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "CLI tests were skipped because no CLI-related files changed."
exit 0
fi
- echo "CLI tests were not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1
web-tests-run:
@@ -345,17 +335,6 @@ jobs:
uses: ./.github/workflows/web-tests.yml
secrets: inherit
- web-tests-skip:
- name: Skip Web Tests
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.web-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped web tests
- run: echo "No web-related changes detected; skipping web tests."
-
web-tests:
name: Web Tests
if: ${{ always() }}
@@ -363,21 +342,26 @@ jobs:
- pre_job
- check-changes
- web-tests-run
- - web-tests-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize Web Tests status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.web-changed }}
RUN_RESULT: ${{ needs.web-tests-run.result }}
- SKIP_RESULT: ${{ needs.web-tests-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "Web tests were skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "Web tests ran successfully."
@@ -388,12 +372,12 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "Web tests were skipped because no web-related files changed."
exit 0
fi
- echo "Web tests were not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1
web-e2e-run:
@@ -407,17 +391,6 @@ jobs:
run-external-runtime: false
secrets: inherit
- web-e2e-skip:
- name: Skip Web Full-Stack E2E
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.e2e-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped web full-stack e2e
- run: echo "No E2E-related changes detected; skipping web full-stack E2E."
-
web-e2e:
name: Web Full-Stack E2E
if: ${{ always() }}
@@ -425,21 +398,26 @@ jobs:
- pre_job
- check-changes
- web-e2e-run
- - web-e2e-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize Web Full-Stack E2E status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.e2e-changed }}
RUN_RESULT: ${{ needs.web-e2e-run.result }}
- SKIP_RESULT: ${{ needs.web-e2e-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "Web full-stack E2E was skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "Web full-stack E2E ran successfully."
@@ -450,12 +428,12 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "Web full-stack E2E was skipped because no E2E-related files changed."
exit 0
fi
- echo "Web full-stack E2E was not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1
style-check:
@@ -483,17 +461,6 @@ jobs:
if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.vdb-changed == 'true'
uses: ./.github/workflows/vdb-tests.yml
- vdb-tests-skip:
- name: Skip VDB Tests
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.vdb-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped VDB tests
- run: echo "No VDB-related changes detected; skipping VDB tests."
-
vdb-tests:
name: VDB Tests
if: ${{ always() }}
@@ -501,21 +468,26 @@ jobs:
- pre_job
- check-changes
- vdb-tests-run
- - vdb-tests-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize VDB Tests status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.vdb-changed }}
RUN_RESULT: ${{ needs.vdb-tests-run.result }}
- SKIP_RESULT: ${{ needs.vdb-tests-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "VDB tests were skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "VDB tests ran successfully."
@@ -526,12 +498,12 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "VDB tests were skipped because no VDB-related files changed."
exit 0
fi
- echo "VDB tests were not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1
db-migration-test-run:
@@ -542,17 +514,6 @@ jobs:
if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.migration-changed == 'true'
uses: ./.github/workflows/db-migration-test.yml
- db-migration-test-skip:
- name: Skip DB Migration Test
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.migration-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped DB migration tests
- run: echo "No migration-related changes detected; skipping DB migration tests."
-
db-migration-test:
name: DB Migration Test
if: ${{ always() }}
@@ -560,21 +521,26 @@ jobs:
- pre_job
- check-changes
- db-migration-test-run
- - db-migration-test-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize DB Migration Test status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.migration-changed }}
RUN_RESULT: ${{ needs.db-migration-test-run.result }}
- SKIP_RESULT: ${{ needs.db-migration-test-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "DB migration tests were skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "DB migration tests ran successfully."
@@ -585,12 +551,12 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "DB migration tests were skipped because no migration-related files changed."
exit 0
fi
- echo "DB migration tests were not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1
sandbox-runtime-tests-run:
@@ -602,17 +568,6 @@ jobs:
uses: ./.github/workflows/sandbox-runtime-tests.yml
secrets: inherit
- sandbox-runtime-tests-skip:
- name: Skip Sandbox Runtime Tests
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.sandbox-runtime-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped sandbox runtime tests
- run: echo "No sandbox-runtime-related changes detected; skipping sandbox runtime tests."
-
sandbox-runtime-tests:
name: Sandbox Runtime Tests
if: ${{ always() }}
@@ -620,21 +575,26 @@ jobs:
- pre_job
- check-changes
- sandbox-runtime-tests-run
- - sandbox-runtime-tests-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize Sandbox Runtime Tests status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.sandbox-runtime-changed }}
RUN_RESULT: ${{ needs.sandbox-runtime-tests-run.result }}
- SKIP_RESULT: ${{ needs.sandbox-runtime-tests-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "Sandbox runtime tests were skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "Sandbox runtime tests ran successfully."
@@ -645,12 +605,12 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "Sandbox runtime tests were skipped because no sandbox-runtime-related files changed."
exit 0
fi
- echo "Sandbox runtime tests were not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1
dify-agent-tests-run:
@@ -662,17 +622,6 @@ jobs:
uses: ./.github/workflows/dify-agent-tests.yml
secrets: inherit
- dify-agent-tests-skip:
- name: Skip Dify Agent Tests
- needs:
- - pre_job
- - check-changes
- if: needs.pre_job.outputs.should_skip != 'true' && needs.check-changes.outputs.dify-agent-changed != 'true'
- runs-on: depot-ubuntu-24.04
- steps:
- - name: Report skipped dify agent tests
- run: echo "No dify-agent-related changes detected; skipping dify agent tests."
-
dify-agent-tests:
name: Dify Agent Tests
if: ${{ always() }}
@@ -680,21 +629,26 @@ jobs:
- pre_job
- check-changes
- dify-agent-tests-run
- - dify-agent-tests-skip
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
steps:
- name: Finalize Dify Agent Tests status
env:
SHOULD_SKIP_WORKFLOW: ${{ needs.pre_job.outputs.should_skip }}
TESTS_CHANGED: ${{ needs.check-changes.outputs.dify-agent-changed }}
RUN_RESULT: ${{ needs.dify-agent-tests-run.result }}
- SKIP_RESULT: ${{ needs.dify-agent-tests-skip.result }}
+ PRE_JOB_RESULT: ${{ needs.pre_job.result }}
+ CHANGES_RESULT: ${{ needs.check-changes.result }}
run: |
if [[ "$SHOULD_SKIP_WORKFLOW" == 'true' ]]; then
echo "Dify agent tests were skipped because this workflow run duplicated a successful or newer run."
exit 0
fi
+ if [[ "$PRE_JOB_RESULT" != 'success' || "$CHANGES_RESULT" != 'success' ]]; then
+ echo "Cannot finalize tests: duplicate check=$PRE_JOB_RESULT, change detection=$CHANGES_RESULT" >&2
+ exit 1
+ fi
+
if [[ "$TESTS_CHANGED" == 'true' ]]; then
if [[ "$RUN_RESULT" == 'success' ]]; then
echo "Dify agent tests ran successfully."
@@ -705,10 +659,10 @@ jobs:
exit 1
fi
- if [[ "$SKIP_RESULT" == 'success' ]]; then
+ if [[ "$TESTS_CHANGED" == 'false' && "$RUN_RESULT" == 'skipped' ]]; then
echo "Dify agent tests were skipped because no dify-agent-related files changed."
exit 0
fi
- echo "Dify agent tests were not required, but the skip job finished with result: $SKIP_RESULT" >&2
+ echo "Unexpected test state: changed=$TESTS_CHANGED, result=$RUN_RESULT" >&2
exit 1