Skip to content

Commit eb0e101

Browse files
committed
Fix fast CI workflow to run unit tests and generate docs after tests pass
1 parent 1df2af3 commit eb0e101

File tree

1 file changed

+48
-30
lines changed

1 file changed

+48
-30
lines changed

.github/workflows/fast-continuous-integration.yml

Lines changed: 48 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,9 @@ jobs:
3434
distribution: 'temurin'
3535
cache: 'maven'
3636

37-
- name: Build all modules (skip tests)
37+
- name: Build all modules with unit tests
3838
run: |
39-
./mvnw -T 1C -DskipTests --batch-mode --update-snapshots clean install
40-
41-
- name: Generate Java docs
42-
if: github.ref == 'refs/heads/main'
43-
run: ./mvnw --batch-mode javadoc:aggregate
44-
45-
- name: Generate assembly
46-
if: github.ref == 'refs/heads/main'
47-
working-directory: spring-ai-docs
48-
run: ../mvnw --batch-mode assembly:single
39+
./mvnw -T 1C --batch-mode --update-snapshots clean install
4940
5041
- name: Upload Maven repository
5142
uses: actions/upload-artifact@v4
@@ -54,22 +45,6 @@ jobs:
5445
path: ~/.m2/repository
5546
retention-days: 1
5647

57-
- name: Upload Javadoc
58-
if: github.ref == 'refs/heads/main'
59-
uses: actions/upload-artifact@v4
60-
with:
61-
name: javadoc
62-
path: target/site/apidocs
63-
retention-days: 1
64-
65-
- name: Upload assembly
66-
if: github.ref == 'refs/heads/main'
67-
uses: actions/upload-artifact@v4
68-
with:
69-
name: assembly
70-
path: spring-ai-docs/target/*.zip
71-
retention-days: 1
72-
7348
test-ollama:
7449
name: Test Ollama
7550
runs-on: ubuntu-latest
@@ -110,7 +85,7 @@ jobs:
11085
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
11186
run: |
11287
./mvnw --batch-mode --no-snapshot-updates \
113-
-pl auto-configurations/models/spring-ai-autoconfigure-model-ollama \
88+
-pl models/spring-ai-ollama,auto-configurations/models/spring-ai-autoconfigure-model-ollama \
11489
-Pci-fast-integration-tests \
11590
-Dfailsafe.rerunFailingTestsCount=3 \
11691
verify
@@ -184,11 +159,54 @@ jobs:
184159
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
185160
run: |
186161
./mvnw --batch-mode --no-snapshot-updates \
187-
-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 \
162+
-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 \
188163
-Pci-fast-integration-tests \
189164
-Dfailsafe.rerunFailingTestsCount=3 \
190165
verify
191166
167+
generate-artifacts:
168+
name: Generate documentation artifacts
169+
runs-on: ubuntu-latest
170+
needs: [build-all, test-ollama, test-openai, test-remaining]
171+
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'spring-projects' }}
172+
steps:
173+
- name: Checkout source code
174+
uses: actions/checkout@v4
175+
176+
- name: Set up JDK 17
177+
uses: actions/setup-java@v4
178+
with:
179+
java-version: '17'
180+
distribution: 'temurin'
181+
cache: 'maven'
182+
183+
- name: Download Maven repository
184+
uses: actions/download-artifact@v4
185+
with:
186+
name: maven-repo
187+
path: ~/.m2/repository
188+
189+
- name: Generate Java docs
190+
run: ./mvnw --batch-mode javadoc:aggregate
191+
192+
- name: Generate assembly
193+
working-directory: spring-ai-docs
194+
run: ../mvnw --batch-mode assembly:single
195+
196+
- name: Upload Javadoc
197+
uses: actions/upload-artifact@v4
198+
with:
199+
name: javadoc
200+
path: target/site/apidocs
201+
retention-days: 1
202+
203+
- name: Upload assembly
204+
uses: actions/upload-artifact@v4
205+
with:
206+
name: assembly
207+
path: spring-ai-docs/target/*.zip
208+
retention-days: 1
209+
192210
deploy-artifactory:
193211
name: Deploy to Artifactory
194212
runs-on: ubuntu-latest
@@ -221,7 +239,7 @@ jobs:
221239
deploy-docs:
222240
name: Deploy documentation
223241
runs-on: ubuntu-latest
224-
needs: [build-all, test-ollama, test-openai, test-remaining]
242+
needs: [generate-artifacts]
225243
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'spring-projects' }}
226244
steps:
227245
- name: Checkout source code

0 commit comments

Comments
 (0)