From e068046a39d34f5802ed2a08c687e1a73cf19492 Mon Sep 17 00:00:00 2001 From: Tyson McNulty Date: Tue, 1 Oct 2024 16:07:42 -0400 Subject: [PATCH] Add scheduled jobs - Anthropic - Hugging Face - Mistral AI - OCI GenAI - OpenAI - Stability AI --- .../workflows/spring-ai-integration-tests.yml | 184 +++++++++++++++++- 1 file changed, 183 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spring-ai-integration-tests.yml b/.github/workflows/spring-ai-integration-tests.yml index 5c7ca43..eda0cc3 100644 --- a/.github/workflows/spring-ai-integration-tests.yml +++ b/.github/workflows/spring-ai-integration-tests.yml @@ -7,7 +7,37 @@ on: - cron: '0 10 * * 1-5' jobs: - test-azure: + test-anthropic: + runs-on: ubuntu-latest + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + 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: Check out repository code + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-ai + ref: refs/heads/main + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Install + run: ./mvnw install -DskipTests + - name: Run Anthropic model tests + run: ./mvnw -pl models/spring-ai-anthropic -Pintegration-tests -Dfailsafe.rerunFailingTestsCount=2 verify + + test-azure-openai: env: AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} @@ -69,12 +99,164 @@ jobs: - name: Run Bedrock model tests run: ./mvnw -pl models/spring-ai-bedrock -Pintegration-tests -Dfailsafe.rerunFailingTestsCount=2 verify + test-huggingface: + runs-on: ubuntu-latest + env: + HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} + HUGGINGFACE_CHAT_URL: ${{ secrets.HUGGINGFACE_CHAT_URL }} + 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: Check out repository code + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-ai + ref: refs/heads/main + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Install + run: ./mvnw install -DskipTests + - name: Run Hugging Face model tests + run: ./mvnw -pl models/spring-ai-huggingface -Pintegration-tests -Dfailsafe.rerunFailingTestsCount=2 verify + + test-mistral-ai: + runs-on: ubuntu-latest + env: + MISTRAL_AI_API_KEY: ${{ secrets.MISTRAL_AI_API_KEY }} + 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: Check out repository code + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-ai + ref: refs/heads/main + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Install + run: ./mvnw install -DskipTests + - name: Run Mistral AI model tests + run: ./mvnw -pl models/spring-ai-mistral-ai -Pintegration-tests -Dfailsafe.rerunFailingTestsCount=2 verify + + test-oci-genai: + runs-on: ubuntu-latest + env: + OCI_COMPARTMENT_ID_KEY: ${{ secrets.OCI_COMPARTMENT_ID_KEY }} + 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: Check out repository code + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-ai + ref: refs/heads/main + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Install + run: ./mvnw install -DskipTests + - name: Run OCI GenAI model tests + run: ./mvnw -pl models/spring-ai-oci-genai -Pintegration-tests -Dfailsafe.rerunFailingTestsCount=2 verify + + test-openai: + runs-on: ubuntu-latest + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + 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: Check out repository code + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-ai + ref: refs/heads/main + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Install + run: ./mvnw install -DskipTests + - name: Run OpenAI model tests + run: ./mvnw -pl models/spring-ai-openai -Pintegration-tests -Dfailsafe.rerunFailingTestsCount=2 verify + + test-stability-ai: + runs-on: ubuntu-latest + env: + STABILITYAI_API_KEY: ${{ secrets.STABILITYAI_API_KEY }} + 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: Check out repository code + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-ai + ref: refs/heads/main + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Install + run: ./mvnw install -DskipTests + - name: Run Stability AI model tests + run: ./mvnw -pl models/spring-ai-stability-ai -Pintegration-tests -Dfailsafe.rerunFailingTestsCount=2 verify + test-autoconfigure: 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 }} + # TODO: add keys to add models runs-on: ubuntu-latest steps: - name: Check environment