From 8b19ba5cc00b927530bddb9143ddbb9e734ba9bf Mon Sep 17 00:00:00 2001 From: Ilayaperumal Gopinathan Date: Thu, 25 Jun 2026 16:39:17 +0100 Subject: [PATCH] Move Spring AI integration tests' workflow Signed-off-by: Ilayaperumal Gopinathan --- .../actions/do-autoconfigure-test/action.yml | 497 +++++++++++++++ .../actions/do-integration-test/action.yml | 34 ++ .../actions/do-multi-module-test/action.yml | 34 ++ ...pring-ai-integration-tests-manual-only.yml | 132 ++++ ...ration-tests-spring-boot-compatibility.yml | 569 ++++++++++++++++++ .../workflows/spring-ai-integration-tests.yml | 561 +++++++++++++++++ 6 files changed, 1827 insertions(+) create mode 100644 .github/actions/do-autoconfigure-test/action.yml create mode 100644 .github/actions/do-integration-test/action.yml create mode 100644 .github/actions/do-multi-module-test/action.yml create mode 100644 .github/workflows/spring-ai-integration-tests-manual-only.yml create mode 100644 .github/workflows/spring-ai-integration-tests-spring-boot-compatibility.yml create mode 100644 .github/workflows/spring-ai-integration-tests.yml diff --git a/.github/actions/do-autoconfigure-test/action.yml b/.github/actions/do-autoconfigure-test/action.yml new file mode 100644 index 0000000000..f0e2bcf8ea --- /dev/null +++ b/.github/actions/do-autoconfigure-test/action.yml @@ -0,0 +1,497 @@ +name: "Run Spring AI Autoconfigure Integration Tests" +description: "Run integration tests for all Spring AI auto-configuration modules" + +inputs: + spring-ai-branch: + description: "Spring AI branch being tested (used for branch-specific test conditions)" + required: true + default: "main" + maven-properties: + description: "Additional Maven properties to pass to the build" + required: false + default: "" + +runs: + using: "composite" + steps: + - name: Check environment + uses: actions/github-script@v7 + with: + script: | + const env = ${{ toJson(env) }} + const emptyEnvEntries = Object.entries(env).filter(e => e[1].length === 0) + emptyEnvEntries.length > 0 && + core.setFailed('Missing value for environment variable(s): ' + emptyEnvEntries.map(e => e[0]).join(', ')); + + - name: Run Spring AI Retry Autoconfigure test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/common/spring-ai-autoconfigure-retry \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Chat Observation test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/chat/observation/spring-ai-autoconfigure-model-chat-observation \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Embedding Observation test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/embedding/observation/spring-ai-autoconfigure-model-embedding-observation \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Image Observation test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/image/observation/spring-ai-autoconfigure-model-image-observation \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Chat Client test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/chat/client/spring-ai-autoconfigure-model-chat-client \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Neo4j Chat memory repository test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/chat/memory/repository/spring-ai-autoconfigure-model-chat-memory-repository-neo4j \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Cassandra Chat memory repository test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/chat/memory/repository/spring-ai-autoconfigure-model-chat-memory-repository-cassandra \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure JDBC Chat memory repository test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/chat/memory/repository/spring-ai-autoconfigure-model-chat-memory-repository-jdbc \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MongoDB Chat memory repository test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/chat/memory/repository/spring-ai-autoconfigure-model-chat-memory-repository-mongodb \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Redis Chat memory test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/chat/memory/spring-ai-autoconfigure-model-chat-memory-redis \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Tooling test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/tool/spring-ai-autoconfigure-model-tool \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Anthropic Model test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-anthropic \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure DeepSeek test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-deepseek \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure ElevenLabs test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-elevenlabs \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Google GenAI test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-google-genai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Azure OpenAI test + if: ${{ inputs.spring-ai-branch != 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-azure-openai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Bedrock AI test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Huggingface test + if: ${{ inputs.spring-ai-branch == '1.1.x' || inputs.spring-ai-branch == '1.0.x' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-huggingface \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Minimax test + if: ${{ inputs.spring-ai-branch != 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-minimax \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Mistral AI test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-mistral-ai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure OCI GenAI test + if: ${{ inputs.spring-ai-branch == '1.1.x' || inputs.spring-ai-branch == '1.0.x' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-oci-genai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Ollama test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-ollama \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure OpenAI test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-openai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure PostgresML Embedding test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-postgresml-embedding \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Stability AI test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-stability-ai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Transformers test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-transformers \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Vertex AI test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-vertex-ai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure ZhipuAI test + if: ${{ inputs.spring-ai-branch == '1.1.x' || inputs.spring-ai-branch == '1.0.x' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/models/spring-ai-autoconfigure-model-zhipuai \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Azure vector store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-azure \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Azure Cosmos DB test + if: ${{ inputs.spring-ai-branch == '1.1.x' || inputs.spring-ai-branch == '1.0.x' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-azure-cosmos-db \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Cassandra Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-cassandra \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Chroma Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Couchbase Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-couchbase \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure ElasticSearch Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-elasticsearch \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure GemFire Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-gemfire \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Mariadb Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-mariadb \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Milvus Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-milvus \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MongoDB Atlas Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-mongodb-atlas \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Neo4j Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-neo4j \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Vector Store Observation test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-observation \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Opensearch Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-opensearch \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Oracle Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-oracle \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Pgvector test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-pgvector \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Pinecone Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-pinecone \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Qdrant Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-qdrant \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Redis Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-redis \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Redis Semantic Cache Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-redis-semantic-cache \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Typesense Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-typesense \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure Weaviate Vector Store test + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-weaviate \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP Client test + if: ${{ inputs.spring-ai-branch == '1.0.x' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-client \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP common Client test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-common \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP HTTP Client test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-httpclient \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP Webflux Client test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-webflux \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP Server test + if: ${{ inputs.spring-ai-branch == '1.0.x' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-server \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP common Server test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-common \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP Webflux Server test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webflux \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify + + - name: Run Spring AI Autoconfigure MCP WebMVC Server test + if: ${{ inputs.spring-ai-branch == 'main' }} + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webmvc \ + -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify diff --git a/.github/actions/do-integration-test/action.yml b/.github/actions/do-integration-test/action.yml new file mode 100644 index 0000000000..f04413c44d --- /dev/null +++ b/.github/actions/do-integration-test/action.yml @@ -0,0 +1,34 @@ +name: "Run Spring AI Integration Test" +description: "Run integration tests for a single Spring AI model module" + +inputs: + model-name: + description: "Spring AI model to integration test (e.g. ollama, anthropic, mistral-ai)" + required: true + maven-properties: + description: "Additional Maven properties to pass to the build" + required: false + default: "" + +runs: + using: "composite" + steps: + - name: Check environment + uses: actions/github-script@v7 + with: + script: | + const env = ${{ toJson(env) }} + const emptyEnvEntries = Object.entries(env).filter(e => e[1].length === 0) + emptyEnvEntries.length > 0 && + core.setFailed('Missing value for environment variable(s): ' + emptyEnvEntries.map(e => e[0]).join(', ')); + + - name: Run ${{ inputs.model-name }} model tests + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl models/spring-ai-${{ inputs.model-name }} \ + -Pintegration-tests \ + ${{ inputs.maven-properties }} \ + -Dfailsafe.rerunFailingTestsCount=2 \ + verify diff --git a/.github/actions/do-multi-module-test/action.yml b/.github/actions/do-multi-module-test/action.yml new file mode 100644 index 0000000000..1ddb7ecdcc --- /dev/null +++ b/.github/actions/do-multi-module-test/action.yml @@ -0,0 +1,34 @@ +name: "Run Spring AI Multi-Module Integration Tests" +description: "Run integration tests for multiple Spring AI modules" + +inputs: + modules: + description: "Comma-separated list of modules to test" + required: true + maven-properties: + description: "Additional Maven properties to pass to the build" + required: false + default: "" + +runs: + using: "composite" + steps: + - name: Check environment + uses: actions/github-script@v7 + with: + script: | + const env = ${{ toJson(env) }} + const emptyEnvEntries = Object.entries(env).filter(e => e[1].length === 0) + emptyEnvEntries.length > 0 && + core.setFailed('Missing value for environment variable(s): ' + emptyEnvEntries.map(e => e[0]).join(', ')); + + - name: Run integration tests + shell: bash + run: | + echo 'Running with maven properties:' ${{ inputs.maven-properties }} + ./mvnw --batch-mode -ntp --no-snapshot-updates \ + -pl ${{ inputs.modules }} \ + -Pintegration-tests \ + ${{ inputs.maven-properties }} \ + -Dfailsafe.rerunFailingTestsCount=2 \ + verify diff --git a/.github/workflows/spring-ai-integration-tests-manual-only.yml b/.github/workflows/spring-ai-integration-tests-manual-only.yml new file mode 100644 index 0000000000..785605a14d --- /dev/null +++ b/.github/workflows/spring-ai-integration-tests-manual-only.yml @@ -0,0 +1,132 @@ +name: Spring AI Integration Tests (Manual Only) +run-name: Spring AI Integration Tests (Manual Only) + +on: + - workflow_dispatch + +jobs: + + test-minimax: + if: ${{ github.repository_owner == 'spring-projects' }} + runs-on: ubuntu-latest + env: + MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }} + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Build all modules + run: ./mvnw --batch-mode -ntp install -DskipTests + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: minimax + + test-moonshot: + if: ${{ github.repository_owner == 'spring-projects' }} + runs-on: ubuntu-latest + env: + MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }} + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Build all modules + run: ./mvnw --batch-mode -ntp install -DskipTests + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: moonshot + + test-qianfan: + if: ${{ github.repository_owner == 'spring-projects' }} + runs-on: ubuntu-latest + env: + QIANFAN_API_KEY: ${{ secrets.QIANFAN_API_KEY }} + QIANFAN_SECRET_KEY: ${{ secrets.QIANFAN_SECRET_KEY }} + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Build all modules + run: ./mvnw --batch-mode -ntp install -DskipTests + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: qianfan + + test-zhipu-ai: + if: ${{ github.repository_owner == 'spring-projects' }} + runs-on: ubuntu-latest + env: + ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }} + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Build all modules + run: ./mvnw --batch-mode -ntp install -DskipTests + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: zhipuai + + test-autoconfigure: + if: ${{ github.repository_owner == 'spring-projects' }} + runs-on: ubuntu-latest + env: + MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }} + MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }} + QIANFAN_API_KEY: ${{ secrets.QIANFAN_API_KEY }} + QIANFAN_SECRET_KEY: ${{ secrets.QIANFAN_SECRET_KEY }} + ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }} + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Build all modules + run: ./mvnw --batch-mode -ntp install -DskipTests + + - name: Autoconfigure Test + uses: ./.github/actions/do-autoconfigure-test + with: + spring-ai-branch: main diff --git a/.github/workflows/spring-ai-integration-tests-spring-boot-compatibility.yml b/.github/workflows/spring-ai-integration-tests-spring-boot-compatibility.yml new file mode 100644 index 0000000000..798bc7073e --- /dev/null +++ b/.github/workflows/spring-ai-integration-tests-spring-boot-compatibility.yml @@ -0,0 +1,569 @@ +name: Spring AI Integration Tests (Spring Boot Compatibility) +run-name: Spring AI Integration Tests (Spring Boot Compatibility) + +on: + workflow_dispatch: + inputs: + springBootVersion: + description: "Spring Boot version to test against" + required: true + test_suites: + description: 'Test suites to run (comma-separated: ollama, anthropic, azure-openai, mistral-ai, elevenlabs, vectorstores, autoconfigure, spring-ai-integration, docker-compose, testcontainers). Leave empty to run all.' + required: false + default: '' + type: string + +jobs: + + build-all: + name: Build all modules + if: ${{ github.repository_owner == 'spring-projects' }} + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Build all modules + run: ./mvnw --batch-mode -ntp --update-snapshots clean install -DskipTests -Dspring-boot.version=${{ github.event.inputs.springBootVersion }} + + - name: Upload Spring AI built artifacts + uses: actions/upload-artifact@v6 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + retention-days: 1 + + - name: Purge Spring AI built artifacts + run: rm -fr ~/.m2/repository/org/springframework/ai + + test-ollama: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'ollama') }} + runs-on: ubuntu-latest + services: + ollama: + image: ollama/ollama:latest + ports: + - 11434:11434 + env: + OLLAMA_WITH_REUSE: true + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: ollama + maven-properties: "-Dskip.model.ollama=false -Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-anthropic: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'anthropic') }} + runs-on: ubuntu-latest + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + steps: + - name: Check secret + id: secret_check + if: ${{ env.ANTHROPIC_API_KEY != '' }} + run: echo "Secret exists" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: anthropic + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-azure-openai: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'azure-openai') }} + runs-on: ubuntu-latest + env: + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} + AZURE_OPENAI_TRANSCRIPTION_API_KEY: ${{ secrets.AZURE_OPENAI_TRANSCRIPTION_API_KEY }} + AZURE_OPENAI_TRANSCRIPTION_ENDPOINT: ${{ secrets.AZURE_OPENAI_TRANSCRIPTION_ENDPOINT }} + AZURE_OPENAI_IMAGE_API_KEY: ${{ secrets.AZURE_OPENAI_IMAGE_API_KEY }} + AZURE_OPENAI_IMAGE_ENDPOINT: ${{ secrets.AZURE_OPENAI_IMAGE_ENDPOINT }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.AZURE_OPENAI_API_KEY != '' && env.AZURE_OPENAI_ENDPOINT != '' && env.AZURE_OPENAI_TRANSCRIPTION_API_KEY != '' && env.AZURE_OPENAI_TRANSCRIPTION_ENDPOINT != '' && env.AZURE_OPENAI_IMAGE_API_KEY != '' && env.AZURE_OPENAI_IMAGE_ENDPOINT != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: azure-openai + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-mistral-ai: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'mistral-ai') }} + runs-on: ubuntu-latest + env: + MISTRAL_AI_API_KEY: ${{ secrets.MISTRAL_AI_API_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.MISTRAL_AI_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: mistral-ai + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-elevenlabs: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'elevenlabs') }} + runs-on: ubuntu-latest + env: + ELEVEN_LABS_API_KEY: ${{ secrets.ELEVEN_LABS_API_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.ELEVEN_LABS_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: elevenlabs + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-bedrock: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'bedrock') }} + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-multi-module-test + with: + modules: models/spring-ai-bedrock,models/spring-ai-bedrock-converse + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-deepseek: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'deepseek') }} + runs-on: ubuntu-latest + env: + DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} + steps: + - name: Check secret + id: secret_check + if: ${{ env.DEEPSEEK_API_KEY != '' }} + run: echo "Secret exists" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: deepseek + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-google-genai: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'google-genai') }} + runs-on: ubuntu-latest + env: + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + steps: + - name: Check secret + id: secret_check + if: ${{ env.GOOGLE_API_KEY != '' }} + run: echo "Secret exists" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: google-genai + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-vectorstores: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'vectorstores') }} + runs-on: ubuntu-latest + services: + ollama: + image: ollama/ollama:latest + ports: + - 11434:11434 + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + MISTRAL_AI_API_KEY: ${{ secrets.MISTRAL_AI_API_KEY }} + OLLAMA_TESTS_ENABLED: true + steps: + - name: Check secrets + id: secret_check + if: ${{ env.OPENAI_API_KEY != '' && env.MISTRAL_AI_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: vector-stores/spring-ai-azure-store,vector-stores/spring-ai-bedrock-knowledgebase-store,vector-stores/spring-ai-cassandra-store,vector-stores/spring-ai-chroma-store,vector-stores/spring-ai-coherence-store,vector-stores/spring-ai-couchbase-store,vector-stores/spring-ai-elasticsearch-store,vector-stores/spring-ai-gemfire-store,vector-stores/spring-ai-mariadb-store,vector-stores/spring-ai-milvus-store,vector-stores/spring-ai-mongodb-atlas-store,vector-stores/spring-ai-neo4j-store,vector-stores/spring-ai-opensearch-store,vector-stores/spring-ai-oracle-store,vector-stores/spring-ai-pgvector-store,vector-stores/spring-ai-pinecone-store,vector-stores/spring-ai-qdrant-store,vector-stores/spring-ai-redis-semantic-cache,vector-stores/spring-ai-redis-store,vector-stores/spring-ai-typesense-store,vector-stores/spring-ai-weaviate-store + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-autoconfigure: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'autoconfigure') }} + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} +# AZURE_OPENAI_TRANSCRIPTION_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_TRANSCRIPTION_DEPLOYMENT_NAME }} + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} +# HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} +# HUGGINGFACE_CHAT_URL: ${{ secrets.HUGGINGFACE_CHAT_URL }} +# MISTRAL_AI_API_KEY: ${{ secrets.MISTRAL_AI_API_KEY }} +# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} +# PALM_API_KEY: ${{ secrets.PALM_API_KEY }} +# STABILITYAI_API_KEY: ${{ secrets.STABILITYAI_API_KEY }} +# VERTEX_AI_GEMINI_PROJECT_ID: ${{ secrets.VERTEX_AI_GEMINI_PROJECT_ID }} +# VERTEX_AI_GEMINI_LOCATION: ${{ secrets.VERTEX_AI_GEMINI_LOCATION }} + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + + - name: Autoconfigure Test + uses: ./.github/actions/do-autoconfigure-test + with: + spring-ai-branch: main + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-spring-ai-integration: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'spring-ai-integration') }} + runs-on: ubuntu-latest + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.OPENAI_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: spring-ai-integration-tests + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-docker-compose: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'docker-compose') }} + runs-on: ubuntu-latest + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: spring-ai-spring-boot-docker-compose + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" + + test-testcontainers: + needs: build-all + if: ${{ inputs.test_suites == '' || contains(inputs.test_suites, 'testcontainers') }} + runs-on: ubuntu24-2-8-OSS + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + docker-images: false + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: spring-ai-spring-boot-testcontainers + maven-properties: "-Dspring-boot.version=${{ github.event.inputs.springBootVersion }}" diff --git a/.github/workflows/spring-ai-integration-tests.yml b/.github/workflows/spring-ai-integration-tests.yml new file mode 100644 index 0000000000..6741000982 --- /dev/null +++ b/.github/workflows/spring-ai-integration-tests.yml @@ -0,0 +1,561 @@ +name: Spring AI Integration Tests +run-name: Spring AI Integration Tests + +on: + workflow_dispatch: + inputs: + test_suites: + description: 'Test suites to run (comma-separated: ollama, anthropic, azure-openai, mistral-ai, elevenlabs, vectorstores, autoconfigure, spring-ai-integration, docker-compose, testcontainers). Leave empty to run all.' + required: false + default: '' + type: string + exclude_test_suites: + description: 'Test suites to exclude (comma-separated). Takes precedence over test_suites.' + required: false + default: '' + type: string + schedule: + - cron: '0 4 * * 1,3,5' # Mon, Wed, Fri at 4 AM UTC + +jobs: + + build-all: + name: Build all modules + if: ${{ github.repository_owner == 'spring-projects' }} + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Build all modules + run: ./mvnw --batch-mode -ntp --update-snapshots clean install -DskipTests + + - name: Upload Spring AI built artifacts + uses: actions/upload-artifact@v6 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + retention-days: 1 + + - name: Purge Spring AI built artifacts + run: rm -fr ~/.m2/repository/org/springframework/ai + + test-ollama: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'ollama')) && !contains(inputs.exclude_test_suites || '', 'ollama') }} + runs-on: ubuntu-latest + services: + ollama: + image: ollama/ollama:latest + ports: + - 11434:11434 + env: + OLLAMA_WITH_REUSE: true + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: ollama + maven-properties: "-Dskip.model.ollama=false" + + test-anthropic: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'anthropic')) && !contains(inputs.exclude_test_suites || '', 'anthropic') }} + runs-on: ubuntu-latest + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + steps: + - name: Check secret + id: secret_check + if: ${{ env.ANTHROPIC_API_KEY != '' }} + run: echo "Secret exists" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: anthropic + + test-azure-openai: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'azure-openai')) && !contains(inputs.exclude_test_suites || '', 'azure-openai') }} + runs-on: ubuntu-latest + env: + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} + AZURE_OPENAI_TRANSCRIPTION_API_KEY: ${{ secrets.AZURE_OPENAI_TRANSCRIPTION_API_KEY }} + AZURE_OPENAI_TRANSCRIPTION_ENDPOINT: ${{ secrets.AZURE_OPENAI_TRANSCRIPTION_ENDPOINT }} + AZURE_OPENAI_IMAGE_API_KEY: ${{ secrets.AZURE_OPENAI_IMAGE_API_KEY }} + AZURE_OPENAI_IMAGE_ENDPOINT: ${{ secrets.AZURE_OPENAI_IMAGE_ENDPOINT }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.AZURE_OPENAI_API_KEY != '' && env.AZURE_OPENAI_ENDPOINT != '' && env.AZURE_OPENAI_TRANSCRIPTION_API_KEY != '' && env.AZURE_OPENAI_TRANSCRIPTION_ENDPOINT != '' && env.AZURE_OPENAI_IMAGE_API_KEY != '' && env.AZURE_OPENAI_IMAGE_ENDPOINT != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: azure-openai + + test-mistral-ai: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'mistral-ai')) && !contains(inputs.exclude_test_suites || '', 'mistral-ai') }} + runs-on: ubuntu-latest + env: + MISTRAL_AI_API_KEY: ${{ secrets.MISTRAL_AI_API_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.MISTRAL_AI_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: mistral-ai + + test-elevenlabs: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'elevenlabs')) && !contains(inputs.exclude_test_suites || '', 'elevenlabs') }} + runs-on: ubuntu-latest + env: + ELEVEN_LABS_API_KEY: ${{ secrets.ELEVEN_LABS_API_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.ELEVEN_LABS_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + uses: ./.github/actions/do-integration-test + with: + model-name: elevenlabs + + test-bedrock: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'bedrock')) && !contains(inputs.exclude_test_suites || '', 'bedrock') }} + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-multi-module-test + with: + modules: models/spring-ai-bedrock,models/spring-ai-bedrock-converse + + test-deepseek: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'deepseek')) && !contains(inputs.exclude_test_suites || '', 'deepseek') }} + runs-on: ubuntu-latest + env: + DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} + steps: + - name: Check secret + id: secret_check + if: ${{ env.DEEPSEEK_API_KEY != '' }} + run: echo "Secret exists" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: deepseek + + test-google-genai: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'google-genai')) && !contains(inputs.exclude_test_suites || '', 'google-genai') }} + runs-on: ubuntu-latest + env: + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + steps: + - name: Check secret + id: secret_check + if: ${{ env.GOOGLE_API_KEY != '' }} + run: echo "Secret exists" + + - name: Checkout source code + if: steps.secret_check.conclusion == 'success' + uses: actions/checkout@v6 + + - name: Set up JDK + if: steps.secret_check.conclusion == 'success' + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + if: steps.secret_check.conclusion == 'success' + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Integration Test + if: steps.secret_check.conclusion == 'success' + uses: ./.github/actions/do-integration-test + with: + model-name: google-genai + + test-vectorstores: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'vectorstores')) && !contains(inputs.exclude_test_suites || '', 'vectorstores') }} + runs-on: ubuntu-latest + services: + ollama: + image: ollama/ollama:latest + ports: + - 11434:11434 + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + MISTRAL_AI_API_KEY: ${{ secrets.MISTRAL_AI_API_KEY }} + OLLAMA_TESTS_ENABLED: true + steps: + - name: Check secrets + id: secret_check + if: ${{ env.OPENAI_API_KEY != '' && env.MISTRAL_AI_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: vector-stores/spring-ai-azure-store,vector-stores/spring-ai-bedrock-knowledgebase-store,vector-stores/spring-ai-cassandra-store,vector-stores/spring-ai-chroma-store,vector-stores/spring-ai-coherence-store,vector-stores/spring-ai-couchbase-store,vector-stores/spring-ai-elasticsearch-store,vector-stores/spring-ai-gemfire-store,vector-stores/spring-ai-mariadb-store,vector-stores/spring-ai-milvus-store,vector-stores/spring-ai-mongodb-atlas-store,vector-stores/spring-ai-neo4j-store,vector-stores/spring-ai-opensearch-store,vector-stores/spring-ai-oracle-store,vector-stores/spring-ai-pgvector-store,vector-stores/spring-ai-pinecone-store,vector-stores/spring-ai-qdrant-store,vector-stores/spring-ai-redis-semantic-cache,vector-stores/spring-ai-redis-store,vector-stores/spring-ai-typesense-store,vector-stores/spring-ai-weaviate-store + + test-autoconfigure: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'autoconfigure')) && !contains(inputs.exclude_test_suites || '', 'autoconfigure') }} + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} +# AZURE_OPENAI_TRANSCRIPTION_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_TRANSCRIPTION_DEPLOYMENT_NAME }} + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} +# HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} +# HUGGINGFACE_CHAT_URL: ${{ secrets.HUGGINGFACE_CHAT_URL }} +# MISTRAL_AI_API_KEY: ${{ secrets.MISTRAL_AI_API_KEY }} +# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} +# PALM_API_KEY: ${{ secrets.PALM_API_KEY }} +# STABILITYAI_API_KEY: ${{ secrets.STABILITYAI_API_KEY }} +# VERTEX_AI_GEMINI_PROJECT_ID: ${{ secrets.VERTEX_AI_GEMINI_PROJECT_ID }} +# VERTEX_AI_GEMINI_LOCATION: ${{ secrets.VERTEX_AI_GEMINI_LOCATION }} + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + + - name: Autoconfigure Test + uses: ./.github/actions/do-autoconfigure-test + with: + spring-ai-branch: main + + test-spring-ai-integration: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'spring-ai-integration')) && !contains(inputs.exclude_test_suites || '', 'spring-ai-integration') }} + runs-on: ubuntu-latest + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + steps: + - name: Check secrets + id: secret_check + if: ${{ env.OPENAI_API_KEY != '' }} + run: echo "Secrets exist" + + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: spring-ai-integration-tests + + test-docker-compose: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'docker-compose')) && !contains(inputs.exclude_test_suites || '', 'docker-compose') }} + runs-on: ubuntu-latest + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: spring-ai-spring-boot-docker-compose + + test-testcontainers: + needs: build-all + if: ${{ (github.event_name == 'schedule' || inputs.test_suites == '' || contains(inputs.test_suites, 'testcontainers')) && !contains(inputs.exclude_test_suites || '', 'testcontainers') }} + runs-on: ubuntu24-2-8-OSS + env: + DOCKER_QUIET: 1 # Suppresses Docker CLI progress output + TESTCONTAINERS_QUIET: true # Additional quieting for testcontainers + steps: + - name: Checkout source code + uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'liberica' + cache: 'maven' + + - name: Download Spring AI built artifacts + uses: actions/download-artifact@v7 + with: + name: build-artifacts + path: ~/.m2/repository/org/springframework/ai + + - name: Free Disk Space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + large-packages: false + docker-images: false + + - name: Configure Testcontainers + run: | + mkdir -p $HOME + echo "testcontainers.reuse.enable = true" >> $HOME/.testcontainers.properties + + - name: Integration Test + uses: ./.github/actions/do-multi-module-test + with: + modules: spring-ai-spring-boot-testcontainers