From eafca0c431dc6162cb526ff3cd186f825a1e5229 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 31 Jul 2025 18:22:42 +0300 Subject: [PATCH] Add support for multiple database adapters in GitHub Actions workflow, including MARIADB and MONGODB. Set environment variables based on selected adapter for testing. --- .github/workflows/tests.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc20d1f6fb..3d9d79ba10 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -141,6 +141,10 @@ jobs: strategy: fail-fast: false matrix: + db_adapter: [ + MARIADB, + MONGODB + ] service: [ Account, Avatars, @@ -197,9 +201,29 @@ jobs: export _APP_DATABASE_SHARED_TABLES= export _APP_DATABASE_SHARED_TABLES_V1= + # Set DB Adapter Specific ENV Vars using if-elif + if [ "${{ matrix.db_adapter }}" = "MARIADB" ]; then + export _APP_DB_ADAPTER=mariadb + export _APP_DB_HOST=mariadb + export _APP_DB_PORT=3306 + export _APP_DB_SCHEMA=appwrite + elif [ "${{ matrix.db_adapter }}" = "MONGODB" ]; then + export _APP_DB_ADAPTER=mongodb + export _APP_DB_HOST=mongodb + export _APP_DB_PORT=27017 + export _APP_DB_SCHEMA=appwrite + else + echo "Unknown DB adapter: ${{ matrix.db_adapter }}" + exit 1 + fi + docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ + -e _APP_DB_ADAPTER \ + -e _APP_DB_HOST \ + -e _APP_DB_PORT \ + -e _APP_DB_SCHEMA \ appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude-group devKeys,screenshots e2e_shared_mode_test: