File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 36
36
if : ${{ steps.release.outputs.releases_created }}
37
37
uses : gradle/gradle-build-action@v2
38
38
39
+ - name : Compile the openai-java-core project
40
+ run : |
41
+ ./gradlew :openai-java-core:compileJava :openai-java-core:compileTestJava -x test
42
+
43
+ - name : Run the Prism server
44
+ run : |
45
+ ./scripts/mock --daemon
46
+
47
+ - name : Setup GraalVM
48
+ uses : graalvm/setup-graalvm@v1
49
+ with :
50
+ java-version : 21
51
+ distribution : ' graalvm-community'
52
+ cache : gradle
53
+
54
+ - name : Run tests on the openai-java-core project with the GraalVM native-image agent
55
+ run : |
56
+ ./gradlew :openai-java-core:test -x compileJava -x compileTestJava -x compileKotlin -x compileTestKotlin -PgraalvmAgent
57
+
58
+ - name : Check generated GraalVM file
59
+ run : |
60
+ echo "Checking for GraalVM agent metadata files..."
61
+ DIRECTORY=openai-java-core/src/main/resources/META-INF/native-image
62
+ if [ -d "$DIRECTORY" ] && [ "$(ls -A $DIRECTORY)" ]; then
63
+ echo "Files found in $DIRECTORY:"
64
+ ls -l $DIRECTORY
65
+ else
66
+ echo "No files found in $DIRECTORY"
67
+ exit 1
68
+ fi
69
+
39
70
- name : Publish to Sonatype
40
71
if : ${{ steps.release.outputs.releases_created }}
41
72
run : |-
Original file line number Diff line number Diff line change 1
1
plugins {
2
+ id(" java" )
2
3
id(" openai.kotlin" )
3
4
id(" openai.publish" )
4
5
}
@@ -43,3 +44,19 @@ dependencies {
43
44
testImplementation(" org.mockito:mockito-junit-jupiter:5.14.2" )
44
45
testImplementation(" org.mockito.kotlin:mockito-kotlin:4.1.0" )
45
46
}
47
+
48
+ if (project.hasProperty(" graalvmAgent" )) {
49
+ java {
50
+ toolchain {
51
+ languageVersion.set(JavaLanguageVersion .of(21 ))
52
+ vendor.set(JvmVendorSpec .GRAAL_VM )
53
+ }
54
+ }
55
+
56
+ tasks.test {
57
+ maxParallelForks = 1
58
+ forkEvery = 0
59
+ jvmArgs =
60
+ listOf (" -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image" )
61
+ }
62
+ }
You can’t perform that action at this time.
0 commit comments