49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
name: "Setup for SpringAI tests"
|
|
description: "Setup For SpringAI tests"
|
|
|
|
inputs:
|
|
model-name:
|
|
description: "SpringAI Model to integration test"
|
|
required: true
|
|
maven-properties:
|
|
description: "Maven properties to pass to the build"
|
|
required: false
|
|
default: ""
|
|
|
|
runs:
|
|
using: "composite"
|
|
strategy:
|
|
matrix:
|
|
spring_ai_branch: [ main, 1.0.x ]
|
|
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: ${{ inputs.spring-ai-branch }}
|
|
path: spring-ai
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
cache: maven
|
|
|
|
- name: Install
|
|
shell: bash
|
|
run: cd spring-ai && echo 'Running with maven properties:' ${{ inputs.maven-properties }} && ./mvnw -ntp install -DskipTests ${{ inputs.maven-properties }}
|
|
|
|
- name: Run ${{ inputs.model-name }} model tests
|
|
shell: bash
|
|
run: cd spring-ai && echo 'Running with maven properties:' ${{ inputs.maven-properties }} && ./mvnw -ntp -pl models/spring-ai-${{ inputs.model-name }} -Pintegration-tests ${{ inputs.maven-properties }} -Dfailsafe.rerunFailingTestsCount=2 verify
|