-
Notifications
You must be signed in to change notification settings - Fork 38
176 lines (166 loc) · 6.05 KB
/
ci.yml
File metadata and controls
176 lines (166 loc) · 6.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Continuous Integration
on:
push:
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build-apps:
runs-on: ubuntu-latest
env:
AWS_REGION: 'us-east-1'
strategy:
fail-fast: false
matrix:
include:
- app: apps/ai-jvm-analyzer
- app: apps/aiagent
- app: apps/aiagent-agentcore/aiagent
- app: apps/aiagent-agentcore/backoffice/trip
- app: apps/aiagent-agentcore/currency
# Tests in this app need a live Bedrock + AgentCore runtime.
- app: apps/java-spring-ai-agents/aiagent
skipTests: true
- app: apps/java-spring-ai-agents/currency
# Tests need a Postgres + Bedrock environment.
- app: apps/unicorn-spring-ai-agent
skipTests: true
- app: apps/unicorn-store-spring
name: Build ${{ matrix.app }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: 'corretto'
java-version: 25
cache: maven
- name: Java version
run: java --version
- name: Build ${{ matrix.app }} with Maven
run: mvn -B clean package --file pom.xml --no-transfer-progress ${{ matrix.skipTests && '-DskipTests' || '' }}
working-directory: ./${{ matrix.app }}/
# Temporary: backoffice is assembled from multiple sources by
# apps/java-spring-ai-agents/scripts/01-setup.sh. This job mirrors the
# file-combining steps of that script (skipping AWS/direnv setup) so we
# can verify the assembled project compiles.
build-backoffice:
runs-on: ubuntu-latest
env:
AWS_REGION: 'us-east-1'
SRC: apps/java-spring-ai-agents/backoffice
steps:
- uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: 'corretto'
java-version: 25
cache: maven
- name: Assemble backoffice (mirror of 01-setup.sh)
run: |
set -euxo pipefail
DEST="${RUNNER_TEMP}/backoffice"
cp -r "${SRC}/trip" "${DEST}"
cp -r "${SRC}/expense" "${DEST}/src/main/java/com/example/backoffice/expense"
cp "${SRC}/tools/TripTools.java" "${DEST}/src/main/java/com/example/backoffice/trip/TripTools.java"
cp "${SRC}/tools/ExpenseTools.java" "${DEST}/src/main/java/com/example/backoffice/expense/ExpenseTools.java"
cp "${SRC}/tools/pom.xml" "${DEST}/pom.xml"
cp "${SRC}/tools/application.properties" "${DEST}/src/main/resources/application.properties"
- name: Build assembled backoffice with Maven
run: mvn -B clean package --file pom.xml --no-transfer-progress
working-directory: ${{ runner.temp }}/backoffice
build-samples:
runs-on: ubuntu-latest
env:
AWS_REGION: 'us-east-1'
strategy:
fail-fast: false
matrix:
include:
# Tests need Docker/Bedrock/Ollama runtime.
- sample: samples/quality-assurance/ai-agent
skipTests: true
# Tests need a live MCP server runtime.
- sample: samples/quality-assurance/weather
skipTests: true
- sample: samples/security/apikey/ai-agent
- sample: samples/security/apikey/weather
- sample: samples/security/oauth/ai-agent
- sample: samples/security/oauth/authorization-server
# Tests need a running OAuth authorization server.
- sample: samples/security/oauth/weather
skipTests: true
# Tests need Postgres + Docker testcontainers.
- sample: samples/spring-ai-agent
skipTests: true
- sample: samples/spring-ai-simple-chat-client
# Tests need a Spring Cloud Function HTTP runtime.
- sample: samples/spring-cloud-function-demo
skipTests: true
name: Build ${{ matrix.sample }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: 'corretto'
java-version: 25
cache: maven
- name: Java version
run: java --version
- name: Build ${{ matrix.sample }} with Maven
run: mvn -B clean package --file pom.xml --no-transfer-progress ${{ matrix.skipTests && '-DskipTests' || '' }}
working-directory: ./${{ matrix.sample }}/
build-infra:
runs-on: ubuntu-latest
env:
AWS_REGION: 'us-east-1'
steps:
- uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: 'corretto'
java-version: 25
cache: maven
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: AWS CDK version
run: cdk version
- name: Build infra CDK
run: mvn clean package --no-transfer-progress
working-directory: ./infra/cdk/
- name: CDK Synth infra
run: cdk synth
working-directory: ./infra/cdk/
build-thread-dump-lambda:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./infra/scripts/setup/thread-dump-lambda/
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: infra/scripts/setup/thread-dump-lambda/requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Syntax check sources
run: python -m compileall -q src
# - name: Submit Dependency Snapshot
# uses: advanced-security/maven-dependency-submission-action@v4
# with:
# directory: ./apps/unicorn-store-spring/