Refactor response format structure to enforce type safety and add response format in Run also. #619
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
env: | |
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Configure JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Run lint | |
run: ./gradlew spotlessCheck | |
test-jvm: | |
name: Test JVM | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
matrix: | |
include: | |
- name: Assistants | |
test: "*.TestAssistants" | |
- name: Audio | |
test: "*.TestAudio" | |
- name: Chat Completions | |
test: "*.TestChat*" | |
- name: Embeddings | |
test: "*.TestEmbeddings" | |
- name: Files | |
test: "*.TestFiles" | |
- name: Fine-tuning | |
test: "*.TestFineTuning" | |
- name: Images | |
test: "*.TestImages" | |
- name: Messages | |
test: "*.TestMessages" | |
- name: Models | |
test: "*.TestModels" | |
- name: Moderations | |
test: "*.TestModerations" | |
- name: Runs | |
test: "*.TestRuns" | |
- name: Threads | |
test: "*.TestThreads" | |
- name: Vector Stores | |
test: "*.TestVectorStores" | |
- name: Misc. | |
test: "*.misc.*" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Configure JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Test ${{ matrix.name }} | |
run: ./gradlew :openai-client:jvmTest --tests ${{ matrix.test }} | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
publish-docs: | |
runs-on: ubuntu-latest | |
needs: [ test-jvm ] | |
if: github.repository == 'aallam/openai-kotlin' && github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Configure JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Build docs | |
run: ./gradlew dokkaHtmlMultiModule | |
- name: Deploy docs | |
uses: JamesIves/github-pages-deploy-action@releases/v4 | |
with: | |
branch: gh-pages | |
folder: docs | |
single-commit: true |