Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
281 changes: 281 additions & 0 deletions .github/workflows/eric-continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
name: Fast CI/CD build

on:
push:
branches:
- 'main'
- '[0-9].[0-9].x'
- 'workflows-rework-main'
schedule:
- cron: '30 11 * * 1-5' # 12:30 PM CET / 6:30 AM EST

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Setup Maven Build-Cache (~/.m2/build-cache)
if: ${{ github.event_name != 'schedule' }}
uses: actions/cache@v4
with:
path: ~/.m2/build-cache
key: build-cache-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-cache-${{ runner.os }}-

- name: Build all modules with unit tests
run: |
./mvnw --batch-mode -ntp --update-snapshots -T1C clean install

- name: Upload Spring-AI Built Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ~/.m2/repository/org/springframework/ai
retention-days: 1 # Intent is to share only with downstream jobs in this workflow

- name: Purge Spring AI Built Artifacts # We don't want the setup-java m2 cache to capture our products, only our deps
run: |
rm -fr ~/.m2/repository/org/springframework/ai


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
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Setup Maven Build-Cache (~/.m2/build-cache)
uses: actions/cache@v4
if: ${{ github.event_name != 'schedule' }}
with:
path: ~/.m2/build-cache
key: build-cache-${{ runner.os }}-ollama-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-cache-${{ runner.os }}-

- name: Download Spring-AI Built Artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ~/.m2/repository/org/springframework/ai

- 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 -ntp --no-snapshot-updates \
-pl models/spring-ai-ollama,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
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Setup Maven Build-Cache (~/.m2/build-cache)
uses: actions/cache@v4
with:
path: ~/.m2/build-cache
key: build-cache-${{ runner.os }}-openai-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-cache-${{ runner.os }}-

- name: Download Spring-AI Built Artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ~/.m2/repository/org/springframework/ai

- 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 -ntp --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-remaining:
name: Test Remaining (MCP, Google GenAI, Chroma, PgVector)
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
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Setup Maven Build-Cache (~/.m2/build-cache)
uses: actions/cache@v4
with:
path: ~/.m2/build-cache
key: build-cache-${{ runner.os }}-other-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-cache-${{ runner.os }}-

- name: Download Spring-AI Built Artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ~/.m2/repository/org/springframework/ai

- 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 -ntp --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,vector-stores/spring-ai-pgvector-store,spring-ai-integration-tests \
-Pci-fast-integration-tests \
-Dfailsafe.rerunFailingTestsCount=3 \
verify

generate-javadocs:
name: Generate and upload javadocs
runs-on: ubuntu-latest
needs: [build-all, test-ollama, test-openai, test-remaining]
if: ${{ github.repository_owner == 'spring-projects' && github.event_name != 'schedule'}}
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Setup Maven Build-Cache (~/.m2/build-cache)
uses: actions/cache@v4
with:
path: ~/.m2/build-cache
key: build-cache-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-cache-${{ runner.os }}-

- name: Generate Java docs
run: ./mvnw --batch-mode -ntp javadoc:aggregate

- name: Capture project version
run: echo PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV

- 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: target/site/apidocs
run: |
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


deploy-artifactory:
name: Deploy to Artifactory
runs-on: ubuntu-latest
needs: [build-all, test-ollama, test-openai, test-remaining]
if: ${{ github.repository_owner == 'spring-projects' && github.event_name != 'schedule' }}
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Setup Maven Build-Cache (~/.m2/build-cache)
uses: actions/cache@v4
with:
path: ~/.m2/build-cache
key: build-cache-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-cache-${{ runner.os }}-

- name: Deploy to Artifactory
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
./mvnw -s settings.xml --batch-mode -ntp -Dmaven.test.skip deploy
31 changes: 0 additions & 31 deletions spring-ai-docs/src/assembly/javadocs.xml

This file was deleted.

Loading