Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit bc81a29

Browse files
committedNov 12, 2023
Require all steps to run in java 1.8
There's definitely a better way to manage version, but trying to run individual steps against later versions was causing my problems than it solved. I'll think of the best way to handle this.
1 parent 987801b commit bc81a29

File tree

6 files changed

+11
-44
lines changed

6 files changed

+11
-44
lines changed
 

‎.github/workflows/gradle-wrapper-validation.yml

-14
This file was deleted.

‎.github/workflows/publish.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,19 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414

15-
- name: Set up JDK 17
15+
- name: Set up JDK 1.8
1616
uses: actions/setup-java@v3
1717
with:
1818
distribution: temurin
19-
java-version: 17
19+
java-version: 8
2020

2121
- name: Test
2222
run: ./gradlew test
2323
env:
2424
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
2525

26-
- name: Set up JDK 1.8
27-
uses: actions/setup-java@v3
28-
with:
29-
distribution: temurin
30-
java-version: 8
31-
3226
- name: Publish
33-
run: ./gradlew build -x :example:build publish --no-parallel
27+
run: ./gradlew build publish --no-parallel
3428
env:
3529
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
3630
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

‎.github/workflows/pull_request.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,5 @@ jobs:
1717
distribution: temurin
1818
java-version: 8
1919

20-
- name: Compile Artifacts
21-
run: ./gradlew api:compileJava client:compileJava service:compileJava
22-
23-
- name: Set up JDK 17
24-
uses: actions/setup-java@v3
25-
with:
26-
distribution: temurin
27-
java-version: 17
28-
29-
- name: Compile Tests
30-
run: ./gradlew compileTestJava
20+
- name: Compile
21+
run: ./gradlew compileJava compileTestJava

‎.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313

14-
- name: Set up JDK 17
14+
- name: Set up JDK 1.8
1515
uses: actions/setup-java@v3
1616
with:
1717
distribution: temurin
18-
java-version: 17
18+
java-version: 8
1919

2020
- name: Test
2121
run: ./gradlew test --stacktrace

‎example/src/main/java/example/OpenAiApiDynamicFunctionExample.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void main(String... args) {
3636
.name("unit")
3737
.type("string")
3838
.description("The temperature unit, can be 'celsius' or 'fahrenheit'")
39-
.enumValues(Set.of("celsius", "fahrenheit"))
39+
.enumValues(new HashSet<>(Arrays.asList("celsius", "fahrenheit")))
4040
.required(true)
4141
.build())
4242
.build();

‎service/src/test/java/com/theokanning/openai/service/ChatCompletionTest.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
import com.theokanning.openai.completion.chat.*;
88
import org.junit.jupiter.api.Test;
99

10-
import java.util.ArrayList;
11-
import java.util.HashMap;
12-
import java.util.List;
13-
import java.util.Set;
14-
import java.util.Collections;
10+
import java.util.*;
1511

1612
import static org.junit.jupiter.api.Assertions.*;
1713

@@ -164,7 +160,7 @@ void createChatCompletionWithDynamicFunctions() {
164160
.name("unit")
165161
.type("string")
166162
.description("The temperature unit, can be 'celsius' or 'fahrenheit'")
167-
.enumValues(Set.of("celsius", "fahrenheit"))
163+
.enumValues(new HashSet<>(Arrays.asList("celsius", "fahrenheit")))
168164
.required(true)
169165
.build())
170166
.build();
@@ -273,7 +269,7 @@ void streamChatCompletionWithDynamicFunctions() {
273269
.name("unit")
274270
.type("string")
275271
.description("The temperature unit, can be 'celsius' or 'fahrenheit'")
276-
.enumValues(Set.of("celsius", "fahrenheit"))
272+
.enumValues(new HashSet<>(Arrays.asList("celsius", "fahrenheit")))
277273
.required(true)
278274
.build())
279275
.build();

0 commit comments

Comments
 (0)
This repository has been archived.