openai/openai-java

Public

mirrored from https://github.com/openai/openai-javaAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.11.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/ci.yml

112lines · modecode

1name: CI
2on:
3 push:
4 branches-ignore:
5 - 'generated'
6 - 'codegen/**'
7 - 'integrated/**'
8 - 'stl-preview-head/**'
9 - 'stl-preview-base/**'
10 pull_request:
11 branches-ignore:
12 - 'stl-preview-head/**'
13 - 'stl-preview-base/**'
14
15jobs:
16 lint:
17 timeout-minutes: 15
18 name: lint
19 runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
21
22 steps:
23 - uses: actions/checkout@v4
24
25 - name: Set up Java
26 uses: actions/setup-java@v4
27 with:
28 distribution: temurin
29 java-version: |
30 8
31 21
32 cache: gradle
33
34 - name: Set up Gradle
35 uses: gradle/actions/setup-gradle@v4
36
37 - name: Run lints
38 run: ./scripts/lint
39
40 build:
41 timeout-minutes: 15
42 name: build
43 runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
44 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
45
46 steps:
47 - uses: actions/checkout@v4
48
49 - name: Set up Java
50 uses: actions/setup-java@v4
51 with:
52 distribution: temurin
53 java-version: |
54 8
55 21
56 cache: gradle
57
58 - name: Set up Gradle
59 uses: gradle/actions/setup-gradle@v4
60
61 - name: Build SDK
62 # disable gradle daemon in CI because it is flakey
63 env:
64 GRADLE_OPTS: "-Dkotlin.compiler.execution.strategy=in-process"
65 run: ./scripts/build
66
67 test:
68 timeout-minutes: 15
69 name: test
70 runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
71 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
72 steps:
73 - uses: actions/checkout@v4
74
75 - name: Set up Java
76 uses: actions/setup-java@v4
77 with:
78 distribution: temurin
79 java-version: |
80 8
81 21
82 cache: gradle
83
84 - name: Set up Gradle
85 uses: gradle/gradle-build-action@v2
86
87 - name: Run tests
88 run: ./scripts/test
89 examples:
90 timeout-minutes: 10
91 name: examples
92 runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
93 if: github.repository == 'openai/openai-java' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
94
95 steps:
96 - uses: actions/checkout@v4
97
98 - name: Set up Java
99 uses: actions/setup-java@v4
100 with:
101 distribution: temurin
102 java-version: |
103 8
104 21
105 cache: gradle
106 - name: Set up Gradle
107 uses: gradle/gradle-build-action@v2
108
109 - env:
110 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
111 run: |
112 ./gradlew :openai-java-example:run
113