Skip to content

Commit 4362dad

Browse files
Teodor Ciuraruclaude
andcommitted
feat: add Java Spring CI workflow and include in PR checks
- Created comprehensive Java Spring CI workflow for standalone testing - Added Java Spring job to PR checks workflow - Covers SDK integration tests, REST API validation, and build verification 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 18c6b1a commit 4362dad

2 files changed

Lines changed: 114 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Java Spring CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- 'java-spring/**'
8+
- '.github/workflows/java-spring-ci.yml'
9+
push:
10+
branches: [main]
11+
paths:
12+
- 'java-spring/**'
13+
- '.github/workflows/java-spring-ci.yml'
14+
workflow_dispatch:
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build-and-test:
22+
name: Build and Test
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Java 17
30+
uses: actions/setup-java@v4
31+
with:
32+
distribution: 'temurin'
33+
java-version: '17'
34+
cache: 'gradle'
35+
36+
- name: Create .env file
37+
run: |
38+
echo "DITTO_APP_ID=${{ secrets.DITTO_APP_ID }}" > .env
39+
echo "DITTO_PLAYGROUND_TOKEN=${{ secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
40+
echo "DITTO_AUTH_URL=${{ secrets.DITTO_AUTH_URL }}" >> .env
41+
echo "DITTO_WEBSOCKET_URL=${{ secrets.DITTO_WEBSOCKET_URL }}" >> .env
42+
43+
- name: Make gradlew executable
44+
working-directory: java-spring
45+
run: chmod +x ./gradlew
46+
47+
- name: Run tests
48+
working-directory: java-spring
49+
run: ./gradlew test --info
50+
51+
- name: Build application
52+
working-directory: java-spring
53+
run: ./gradlew build --info
54+
55+
- name: Generate test report
56+
if: always()
57+
run: |
58+
echo "# Java Spring Build Report" > build-report.md
59+
echo "" >> build-report.md
60+
echo "## Configuration" >> build-report.md
61+
echo "- Java Version: 17 (Temurin)" >> build-report.md
62+
echo "- Spring Boot: 3.4.3" >> build-report.md
63+
echo "- Ditto Java SDK: 5.0.0-preview.1" >> build-report.md
64+
echo "- Build Tool: Gradle" >> build-report.md
65+
echo "" >> build-report.md
66+
echo "## Build Status" >> build-report.md
67+
if [ -f java-spring/build/reports/tests/test/index.html ]; then
68+
echo "✅ Tests completed - see artifacts for detailed report" >> build-report.md
69+
else
70+
echo "❌ Tests failed or incomplete" >> build-report.md
71+
fi
72+
73+
- name: Upload build artifacts
74+
if: always()
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: java-spring-build-results
78+
path: |
79+
java-spring/build/reports/
80+
java-spring/build/libs/
81+
build-report.md

.github/workflows/pr-checks.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,39 @@ jobs:
176176
working-directory: kotlin-multiplatform
177177
run: ./gradlew test
178178

179+
java-spring:
180+
name: Java Spring (ubuntu-24.04)
181+
runs-on: ubuntu-24.04
182+
183+
steps:
184+
- uses: actions/checkout@v4
185+
186+
- name: Set up JDK 17
187+
uses: actions/setup-java@v4
188+
with:
189+
java-version: '17'
190+
distribution: 'temurin'
191+
cache: 'gradle'
192+
193+
- name: Create .env file
194+
run: |
195+
echo "DITTO_APP_ID=${{ secrets.DITTO_APP_ID }}" > .env
196+
echo "DITTO_PLAYGROUND_TOKEN=${{ secrets.DITTO_PLAYGROUND_TOKEN }}" >> .env
197+
echo "DITTO_AUTH_URL=${{ secrets.DITTO_AUTH_URL }}" >> .env
198+
echo "DITTO_WEBSOCKET_URL=${{ secrets.DITTO_WEBSOCKET_URL }}" >> .env
199+
200+
- name: Make gradlew executable
201+
working-directory: java-spring
202+
run: chmod +x ./gradlew
203+
204+
- name: Build project
205+
working-directory: java-spring
206+
run: ./gradlew build
207+
208+
- name: Run tests including integration tests
209+
working-directory: java-spring
210+
run: ./gradlew test
211+
179212
flutter:
180213
name: Flutter (ubuntu-24.04)
181214
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)