From 79598403b38f44c5db51f50e4c85999ee0cff2b4 Mon Sep 17 00:00:00 2001 From: Stream Date: Fri, 8 May 2026 20:43:08 +0800 Subject: [PATCH] fix: CI --- .github/workflows/api-tests.yml | 2 +- .github/workflows/main-ci.yml | 4 ++++ .github/workflows/vdb-tests-full.yml | 2 +- .github/workflows/vdb-tests.yml | 2 +- dev/pytest/pytest_config_tests.py | 18 +++++++++++++----- dev/pytest/pytest_full.sh | 2 +- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/api-tests.yml b/.github/workflows/api-tests.yml index bd47abc710..18da62605b 100644 --- a/.github/workflows/api-tests.yml +++ b/.github/workflows/api-tests.yml @@ -98,7 +98,7 @@ jobs: - name: Set up dotenvs run: | - cp docker/.env.example docker/.env + ./docker/init-env.sh cp docker/middleware.env.example docker/middleware.env - name: Expose Service Ports diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 8071d6204d..0b0a3135af 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -56,7 +56,9 @@ jobs: - 'api/**' - '.github/workflows/api-tests.yml' - '.github/workflows/expose_service_ports.sh' + - 'docker/.env.all' - 'docker/.env.example' + - 'docker/init-env.sh' - 'docker/middleware.env.example' - 'docker/docker-compose.middleware.yaml' - 'docker/docker-compose-template.yaml' @@ -93,7 +95,9 @@ jobs: - 'api/providers/vdb/*/tests/**' - '.github/workflows/vdb-tests.yml' - '.github/workflows/expose_service_ports.sh' + - 'docker/.env.all' - 'docker/.env.example' + - 'docker/init-env.sh' - 'docker/middleware.env.example' - 'docker/docker-compose.yaml' - 'docker/docker-compose-template.yaml' diff --git a/.github/workflows/vdb-tests-full.yml b/.github/workflows/vdb-tests-full.yml index 5c241af5c5..20a18e046b 100644 --- a/.github/workflows/vdb-tests-full.yml +++ b/.github/workflows/vdb-tests-full.yml @@ -50,7 +50,7 @@ jobs: - name: Set up dotenvs run: | - cp docker/.env.example docker/.env + ./docker/init-env.sh cp docker/middleware.env.example docker/middleware.env - name: Expose Service Ports diff --git a/.github/workflows/vdb-tests.yml b/.github/workflows/vdb-tests.yml index 38ec96f00f..533eb43b6f 100644 --- a/.github/workflows/vdb-tests.yml +++ b/.github/workflows/vdb-tests.yml @@ -47,7 +47,7 @@ jobs: - name: Set up dotenvs run: | - cp docker/.env.example docker/.env + ./docker/init-env.sh cp docker/middleware.env.example docker/middleware.env - name: Expose Service Ports diff --git a/dev/pytest/pytest_config_tests.py b/dev/pytest/pytest_config_tests.py index d56cceff5e..0575db693f 100644 --- a/dev/pytest/pytest_config_tests.py +++ b/dev/pytest/pytest_config_tests.py @@ -92,7 +92,7 @@ BASE_API_AND_DOCKER_COMPOSE_CONFIG_SET_DIFF: frozenset[str] = frozenset( ) API_CONFIG_SET = set(dotenv_values(Path("api") / Path(".env.example")).keys()) -DOCKER_CONFIG_SET = set(dotenv_values(Path("docker") / Path(".env.example")).keys()) +DOCKER_CONFIG_SET = set(dotenv_values(Path("docker") / Path(".env.all")).keys()) DOCKER_COMPOSE_CONFIG_SET = set() with open(Path("docker") / Path("docker-compose.yaml")) as f: @@ -101,15 +101,23 @@ with open(Path("docker") / Path("docker-compose.yaml")) as f: def test_yaml_config(): # python set == operator is used to compare two sets - DIFF_API_WITH_DOCKER = API_CONFIG_SET - DOCKER_CONFIG_SET - BASE_API_AND_DOCKER_CONFIG_SET_DIFF + DIFF_API_WITH_DOCKER = ( + API_CONFIG_SET - DOCKER_CONFIG_SET - BASE_API_AND_DOCKER_CONFIG_SET_DIFF + ) if DIFF_API_WITH_DOCKER: - print(f"API and Docker config sets are different with key: {DIFF_API_WITH_DOCKER}") + print( + f"API and Docker config sets are different with key: {DIFF_API_WITH_DOCKER}" + ) raise Exception("API and Docker config sets are different") DIFF_API_WITH_DOCKER_COMPOSE = ( - API_CONFIG_SET - DOCKER_COMPOSE_CONFIG_SET - BASE_API_AND_DOCKER_COMPOSE_CONFIG_SET_DIFF + API_CONFIG_SET + - DOCKER_COMPOSE_CONFIG_SET + - BASE_API_AND_DOCKER_COMPOSE_CONFIG_SET_DIFF ) if DIFF_API_WITH_DOCKER_COMPOSE: - print(f"API and Docker Compose config sets are different with key: {DIFF_API_WITH_DOCKER_COMPOSE}") + print( + f"API and Docker Compose config sets are different with key: {DIFF_API_WITH_DOCKER_COMPOSE}" + ) raise Exception("API and Docker Compose config sets are different") print("All tests passed!") diff --git a/dev/pytest/pytest_full.sh b/dev/pytest/pytest_full.sh index 2989a74ad8..03e494e8f0 100755 --- a/dev/pytest/pytest_full.sh +++ b/dev/pytest/pytest_full.sh @@ -14,7 +14,7 @@ export OPENDAL_FS_ROOT=${OPENDAL_FS_ROOT:-/tmp/dify-storage} mkdir -p "${OPENDAL_FS_ROOT}" # Prepare env files like CI -cp -n docker/.env.example docker/.env || true +./docker/init-env.sh cp -n docker/middleware.env.example docker/middleware.env || true cp -n api/tests/integration_tests/.env.example api/tests/integration_tests/.env || true