Skip to content

Commit f533821

Browse files
committed
initialize
0 parents  commit f533821

30 files changed

Lines changed: 1047 additions & 0 deletions

.github/workflows/e2e.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
e2e-tests:
11+
name: E2E Tests with Bruno
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 30
14+
15+
steps:
16+
- name: Checkout example service
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4
27+
28+
- name: Build service
29+
run: ./gradlew build -x test
30+
31+
- name: Start service in background
32+
run: |
33+
./gradlew bootRun &
34+
echo $! > service.pid
35+
echo "Service started with PID $(cat service.pid)"
36+
37+
- name: Checkout oicana repository (for Bruno tests)
38+
uses: actions/checkout@v4
39+
with:
40+
repository: oicana/oicana
41+
path: oicana
42+
43+
- name: Setup Node.js for Bruno CLI
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: '20'
47+
48+
- name: Install Bruno CLI
49+
run: npm install -g @usebruno/cli
50+
51+
- name: Wait for service to be ready
52+
run: |
53+
echo "Waiting for service on port 3005..."
54+
timeout=120
55+
elapsed=0
56+
while ! curl -f http://localhost:3005/templates 2>/dev/null; do
57+
if [ $elapsed -ge $timeout ]; then
58+
echo "Service did not start within ${timeout} seconds"
59+
if [ -f service.pid ]; then
60+
echo "Service PID: $(cat service.pid)"
61+
ps aux | grep $(cat service.pid) || echo "Service process not found"
62+
fi
63+
exit 1
64+
fi
65+
echo "Waiting... (${elapsed}s/${timeout}s)"
66+
sleep 2
67+
elapsed=$((elapsed + 2))
68+
done
69+
echo "Service is ready!"
70+
71+
- name: Run Bruno E2E tests
72+
working-directory: oicana/e2e-tests/bruno
73+
run: bru run --env spring-boot --reporter-html results.html
74+
75+
- name: Upload test results
76+
if: always()
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: test-results
80+
path: oicana/e2e-tests/bruno/results.html
81+
retention-days: 30
82+
83+
- name: Stop service
84+
if: always()
85+
run: |
86+
if [ -f service.pid ]; then
87+
PID=$(cat service.pid)
88+
echo "Stopping service with PID $PID"
89+
kill $PID || true
90+
sleep 5
91+
kill -9 $PID 2>/dev/null || true
92+
fi

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.gradle/
2+
.project
3+
.classpath
4+
.settings/
5+
build/
6+
bin/
7+
!gradle/wrapper/gradle-wrapper.jar

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Oicana Example Spring Boot
2+
3+
Small example service that uses Oicana for PDF templating.
4+
5+
## Getting Started
6+
7+
1. Start the service: `./gradlew bootRun`
8+
2. Visit http://localhost:3005/swagger-ui.html for the API documentation
9+
10+
## Licensing
11+
12+
The code of this example project is licensed under the [MIT license](LICENSE).
13+
14+
But please be aware that the dependency `com.oicana:oicana` [is licensed under PolyForm Noncommercial License 1.0.0][oicana-license].
15+
16+
17+
[oicana-license]: https://github.com/oicana/oicana?tab=readme-ov-file#licensing
35 KB
Binary file not shown.

build.gradle.kts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
plugins {
2+
java
3+
id("org.springframework.boot") version "3.4.3"
4+
id("io.spring.dependency-management") version "1.1.7"
5+
}
6+
7+
group = "com.oicana"
8+
version = "1.0.0"
9+
10+
java {
11+
sourceCompatibility = JavaVersion.VERSION_17
12+
targetCompatibility = JavaVersion.VERSION_17
13+
}
14+
15+
tasks.withType<JavaExec> {
16+
jvmArgs("--enable-native-access=com.oicana")
17+
}
18+
19+
repositories {
20+
mavenLocal()
21+
mavenCentral()
22+
}
23+
24+
dependencies {
25+
implementation("org.springframework.boot:spring-boot-starter-web")
26+
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6")
27+
implementation("com.oicana:oicana:0.1.0-alpha.1")
28+
// Since this is an example project, we add all native implementations.
29+
// In your project, only add what you need.
30+
runtimeOnly("com.oicana:oicana-linux-x86_64:0.1.0-alpha.1")
31+
runtimeOnly("com.oicana:oicana-linux-aarch64:0.1.0-alpha.1")
32+
runtimeOnly("com.oicana:oicana-macos-x86_64:0.1.0-alpha.1")
33+
runtimeOnly("com.oicana:oicana-macos-aarch64:0.1.0-alpha.1")
34+
runtimeOnly("com.oicana:oicana-windows-x86_64:0.1.0-alpha.1")
35+
}

gradle/wrapper/gradle-wrapper.jar

45.1 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)