Spring AI Integration Tests #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |