openai/openai-java

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.20.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

.github/workflows/ci.yml

130lines · 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@v6
24
25 - name: Set up Java
26 uses: actions/setup-java@v5
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 permissions:
44 contents: read
45 id-token: write
46 runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
47 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
48
49 steps:
50 - uses: actions/checkout@v6
51
52 - name: Set up Java
53 uses: actions/setup-java@v5
54 with:
55 distribution: temurin
56 java-version: |
57 8
58 21
59 cache: gradle
60
61 - name: Set up Gradle
62 uses: gradle/actions/setup-gradle@v4
63
64 - name: Build SDK
65 # disable gradle daemon in CI because it is flakey
66 env:
67 GRADLE_OPTS: "-Dkotlin.compiler.execution.strategy=in-process"
68 run: ./scripts/build
69
70 - name: Get GitHub OIDC Token
71 if: github.repository == 'stainless-sdks/openai-java'
72 id: github-oidc
73 uses: actions/github-script@v8
74 with:
75 script: core.setOutput('github_token', await core.getIDToken());
76
77 - name: Build and upload Maven artifacts
78 if: github.repository == 'stainless-sdks/openai-java'
79 env:
80 URL: https://pkg.stainless.com/s
81 AUTH: ${{ steps.github-oidc.outputs.github_token }}
82 SHA: ${{ github.sha }}
83 PROJECT: openai-java
84 run: ./scripts/upload-artifacts
85 test:
86 timeout-minutes: 15
87 name: test
88 runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
89 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
90 steps:
91 - uses: actions/checkout@v6
92
93 - name: Set up Java
94 uses: actions/setup-java@v5
95 with:
96 distribution: temurin
97 java-version: |
98 8
99 21
100 cache: gradle
101
102 - name: Set up Gradle
103 uses: gradle/gradle-build-action@v2
104
105 - name: Run tests
106 run: ./scripts/test
107 examples:
108 timeout-minutes: 10
109 name: examples
110 runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
111 if: github.repository == 'openai/openai-java' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
112
113 steps:
114 - uses: actions/checkout@v6
115
116 - name: Set up Java
117 uses: actions/setup-java@v5
118 with:
119 distribution: temurin
120 java-version: |
121 8
122 21
123 cache: gradle
124 - name: Set up Gradle
125 uses: gradle/gradle-build-action@v2
126
127 - env:
128 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
129 run: |
130 ./gradlew :openai-java-example:run
131