Add fast-continuous-integration workflow for parallel CI builds #1
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: Fast CI/CD build | ||
| on: | ||
| workflow_dispatch: | ||
| # Note: Schedule triggers commented out for initial testing | ||
| # schedule: | ||
| # - cron: '30 6 * * 1-5' # 7:30 AM CET / 1:30 AM EST | ||
| # - cron: '30 11 * * 1-5' # 12:30 PM CET / 6:30 AM EST | ||
| # - cron: '30 16 * * 1-5' # 7:30 PM CET / 11:30 AM EST | ||
| # - cron: '30 21 * * 1-5' # 10:30 PM CET / 4:30 PM EST | ||
| jobs: | ||
| build-all: | ||
| name: Build all modules | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.repository_owner == 'spring-projects' }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Free Disk Space | ||
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | ||
| with: | ||
| large-packages: false | ||
| docker-images: false | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Build all modules (skip tests) | ||
| run: | | ||
| ./mvnw -T 1C -DskipTests --batch-mode --update-snapshots clean install | ||
| - name: Generate Java docs | ||
| if: github.ref == 'refs/heads/main' | ||
| run: ./mvnw --batch-mode javadoc:aggregate | ||
| - name: Generate assembly | ||
| if: github.ref == 'refs/heads/main' | ||
| working-directory: spring-ai-docs | ||
| run: ../mvnw --batch-mode assembly:single | ||
| - name: Upload Maven repository | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| retention-days: 1 | ||
| - name: Upload Javadoc | ||
| if: github.ref == 'refs/heads/main' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: javadoc | ||
| path: target/site/apidocs | ||
| retention-days: 1 | ||
| - name: Upload assembly | ||
| if: github.ref == 'refs/heads/main' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: assembly | ||
| path: spring-ai-docs/target/*.zip | ||
| retention-days: 1 | ||
| test-ollama: | ||
| name: Test Ollama | ||
| runs-on: ubuntu-latest | ||
| needs: build-all | ||
| if: ${{ github.repository_owner == 'spring-projects' }} | ||
| services: | ||
| ollama: | ||
| image: ollama/ollama:latest | ||
| ports: | ||
| - 11434:11434 | ||
| env: | ||
| OLLAMA_WITH_REUSE: true | ||
| OLLAMA_AUTOCONF_TESTS_ENABLED: "true" | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Download Maven repository | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| - name: Configure Testcontainers | ||
| run: | | ||
| echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties | ||
| - name: Test Ollama modules | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| run: | | ||
| ./mvnw --batch-mode --no-snapshot-updates \ | ||
| -pl auto-configurations/models/spring-ai-autoconfigure-model-ollama \ | ||
| -Pci-fast-integration-tests \ | ||
| -Dfailsafe.rerunFailingTestsCount=3 \ | ||
| verify | ||
| test-openai: | ||
| name: Test OpenAI | ||
| runs-on: ubuntu-latest | ||
| needs: build-all | ||
| if: ${{ github.repository_owner == 'spring-projects' }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Download Maven repository | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| - name: Configure Testcontainers | ||
| run: | | ||
| echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties | ||
| - name: Test OpenAI modules | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| run: | | ||
| ./mvnw --batch-mode --no-snapshot-updates \ | ||
| -pl models/spring-ai-openai,auto-configurations/models/spring-ai-autoconfigure-model-openai \ | ||
| -Pci-fast-integration-tests \ | ||
| -Dfailsafe.rerunFailingTestsCount=3 \ | ||
| verify | ||
| test-vector-stores-slow-1: | ||
| name: Test Vector Stores (OpenSearch, Cassandra) | ||
| runs-on: ubuntu-latest | ||
| needs: build-all | ||
| if: ${{ github.repository_owner == 'spring-projects' }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Download Maven repository | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| - name: Configure Testcontainers | ||
| run: | | ||
| echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties | ||
| - name: Test OpenSearch and Cassandra vector stores | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| run: | | ||
| ./mvnw --batch-mode --no-snapshot-updates \ | ||
| -pl vector-stores/spring-ai-opensearch-store,vector-stores/spring-ai-cassandra-store,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-opensearch,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-cassandra \ | ||
| -Pci-fast-integration-tests \ | ||
| -Dfailsafe.rerunFailingTestsCount=3 \ | ||
| verify | ||
| test-vector-stores-slow-2: | ||
| name: Test Vector Stores (Elasticsearch, Couchbase, MongoDB) | ||
| runs-on: ubuntu-latest | ||
| needs: build-all | ||
| if: ${{ github.repository_owner == 'spring-projects' }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Download Maven repository | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| - name: Configure Testcontainers | ||
| run: | | ||
| echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties | ||
| - name: Test Elasticsearch, Couchbase, MongoDB vector stores | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| run: | | ||
| ./mvnw --batch-mode --no-snapshot-updates \ | ||
| -pl vector-stores/spring-ai-elasticsearch-store,vector-stores/spring-ai-couchbase-store,\ | ||
| vector-stores/spring-ai-mongodb-atlas-store,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-elasticsearch,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-couchbase,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-mongodb-atlas \ | ||
| -Pci-fast-integration-tests \ | ||
| -Dfailsafe.rerunFailingTestsCount=3 \ | ||
| verify | ||
| test-vector-stores-medium: | ||
| name: Test Vector Stores (Milvus, PgVector, Neo4j, MariaDB, Oracle) | ||
| runs-on: ubuntu-latest | ||
| needs: build-all | ||
| if: ${{ github.repository_owner == 'spring-projects' }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Download Maven repository | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| - name: Configure Testcontainers | ||
| run: | | ||
| echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties | ||
| - name: Test Milvus, PgVector, Neo4j, MariaDB, Oracle vector stores | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| run: | | ||
| ./mvnw --batch-mode --no-snapshot-updates \ | ||
| -pl vector-stores/spring-ai-milvus-store,vector-stores/spring-ai-pgvector-store,\ | ||
| vector-stores/spring-ai-neo4j-store,vector-stores/spring-ai-mariadb-store,\ | ||
| vector-stores/spring-ai-oracle-store,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-milvus,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-pgvector,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-neo4j,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-mariadb,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-oracle \ | ||
| -Pci-fast-integration-tests \ | ||
| -Dfailsafe.rerunFailingTestsCount=3 \ | ||
| verify | ||
| test-remaining: | ||
| name: Test Remaining (MCP, Google GenAI, Chroma, etc.) | ||
| runs-on: ubuntu-latest | ||
| needs: build-all | ||
| if: ${{ github.repository_owner == 'spring-projects' }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Download Maven repository | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| - name: Configure Testcontainers | ||
| run: | | ||
| echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties | ||
| - name: Test remaining modules | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| run: | | ||
| ./mvnw --batch-mode --no-snapshot-updates \ | ||
| -pl models/spring-ai-google-genai,\ | ||
| auto-configurations/models/spring-ai-autoconfigure-model-google-genai,\ | ||
| mcp/common,mcp/mcp-annotations-spring,\ | ||
| auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-common,\ | ||
| auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-httpclient,\ | ||
| auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-webflux,\ | ||
| auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-common,\ | ||
| auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webmvc,\ | ||
| auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webflux,\ | ||
| vector-stores/spring-ai-chroma-store,\ | ||
| auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma \ | ||
| -Pci-fast-integration-tests \ | ||
| -Dfailsafe.rerunFailingTestsCount=3 \ | ||
| verify | ||
| deploy-artifacts: | ||
| name: Deploy artifacts | ||
| runs-on: ubuntu-latest | ||
| needs: [build-all, test-ollama, test-openai, test-vector-stores-slow-1, test-vector-stores-slow-2, test-vector-stores-medium, test-remaining] | ||
| if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'spring-projects' }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| - name: Download Maven repository | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: maven-repo | ||
| path: ~/.m2/repository | ||
| - name: Download Javadoc | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: javadoc | ||
| path: target/site/apidocs | ||
| - name: Download assembly | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: assembly | ||
| path: spring-ai-docs/target | ||
| - name: Capture project version | ||
| run: echo PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV | ||
| - name: Deploy to Artifactory | ||
| env: | ||
| ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
| ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
| run: | | ||
| ./mvnw -s settings.xml --batch-mode -DskipTests deploy | ||
| - name: Setup SSH key | ||
| env: | ||
| DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }} | ||
| DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }} | ||
| run: | | ||
| mkdir "$HOME/.ssh" | ||
| echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key" | ||
| chmod 600 "$HOME/.ssh/key" | ||
| echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts" | ||
| - name: Deploy docs | ||
| env: | ||
| DOCS_HOST: ${{ secrets.DOCS_HOST }} | ||
| DOCS_PATH: ${{ secrets.DOCS_PATH }} | ||
| DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }} | ||
| working-directory: spring-ai-docs/target | ||
| run: | | ||
| unzip spring-ai-$PROJECT_VERSION-docs.zip | ||
| ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $PROJECT_VERSION" | ||
| scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION | ||