openai/openai-java
Publicmirrored from https://github.com/openai/openai-javaAvailable
.github/workflows/ci.yml
130lines · modeblame
af9f9a27Robert Craigie2 years ago | 1 | name: CI |
| 2 | on: | |
| 3 | push: | |
3c78e3a5stainless-app[bot]1 years ago | 4 | branches-ignore: |
| 5 | - 'generated' | |
| 6 | - 'codegen/**' | |
| 7 | - 'integrated/**' | |
| 8 | - 'stl-preview-head/**' | |
| 9 | - 'stl-preview-base/**' | |
9c90b165stainless-app[bot]1 years ago | 10 | pull_request: |
| 11 | branches-ignore: | |
| 12 | - 'stl-preview-head/**' | |
| 13 | - 'stl-preview-base/**' | |
af9f9a27Robert Craigie2 years ago | 14 | |
| 15 | jobs: | |
| 16 | lint: | |
984e85d1stainless-app[bot]1 years ago | 17 | timeout-minutes: 15 |
af9f9a27Robert Craigie2 years ago | 18 | name: lint |
3c78e3a5stainless-app[bot]1 years ago | 19 | runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
d8b19b7estainless-app[bot]1 years ago | 20 | if: github.event_name == 'push' || github.event.pull_request.head.repo.fork |
3c78e3a5stainless-app[bot]1 years ago | 21 | |
af9f9a27Robert Craigie2 years ago | 22 | steps: |
de8d6db6stainless-app[bot]6 months ago | 23 | - uses: actions/checkout@v6 |
af9f9a27Robert Craigie2 years ago | 24 | |
| 25 | - name: Set up Java | |
de8d6db6stainless-app[bot]6 months ago | 26 | uses: actions/setup-java@v5 |
af9f9a27Robert Craigie2 years ago | 27 | with: |
| 28 | distribution: temurin | |
| 29 | java-version: | | |
| 30 | 8 | |
3c78e3a5stainless-app[bot]1 years ago | 31 | 21 |
af9f9a27Robert Craigie2 years ago | 32 | cache: gradle |
| 33 | | |
| 34 | - name: Set up Gradle | |
543a08bdstainless-app[bot]1 years ago | 35 | uses: gradle/actions/setup-gradle@v4 |
af9f9a27Robert Craigie2 years ago | 36 | |
| 37 | - name: Run lints | |
| 38 | run: ./scripts/lint | |
b4c700e7stainless-app[bot]12 months ago | 39 | |
| 40 | build: | |
| 41 | timeout-minutes: 15 | |
| 42 | name: build | |
de8d6db6stainless-app[bot]6 months ago | 43 | permissions: |
| 44 | contents: read | |
| 45 | id-token: write | |
b4c700e7stainless-app[bot]12 months ago | 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: | |
de8d6db6stainless-app[bot]6 months ago | 50 | - uses: actions/checkout@v6 |
b4c700e7stainless-app[bot]12 months ago | 51 | |
| 52 | - name: Set up Java | |
de8d6db6stainless-app[bot]6 months ago | 53 | uses: actions/setup-java@v5 |
b4c700e7stainless-app[bot]12 months ago | 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 | |
dae306e5stainless-app[bot]10 months ago | 65 | # disable gradle daemon in CI because it is flakey |
| 66 | env: | |
| 67 | GRADLE_OPTS: "-Dkotlin.compiler.execution.strategy=in-process" | |
b4c700e7stainless-app[bot]12 months ago | 68 | run: ./scripts/build |
| 69 | | |
de8d6db6stainless-app[bot]6 months ago | 70 | - name: Get GitHub OIDC Token |
| 71 | if: github.repository == 'stainless-sdks/openai-java' | |
| 72 | id: github-oidc | |
dc938c56stainless-app[bot]6 months ago | 73 | uses: actions/github-script@v8 |
de8d6db6stainless-app[bot]6 months ago | 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 | |
7a8cd60aStainless Bot2 years ago | 85 | test: |
984e85d1stainless-app[bot]1 years ago | 86 | timeout-minutes: 15 |
7a8cd60aStainless Bot2 years ago | 87 | name: test |
3c78e3a5stainless-app[bot]1 years ago | 88 | runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
d8b19b7estainless-app[bot]1 years ago | 89 | if: github.event_name == 'push' || github.event.pull_request.head.repo.fork |
7a8cd60aStainless Bot2 years ago | 90 | steps: |
de8d6db6stainless-app[bot]6 months ago | 91 | - uses: actions/checkout@v6 |
7a8cd60aStainless Bot2 years ago | 92 | |
| 93 | - name: Set up Java | |
de8d6db6stainless-app[bot]6 months ago | 94 | uses: actions/setup-java@v5 |
7a8cd60aStainless Bot2 years ago | 95 | with: |
| 96 | distribution: temurin | |
| 97 | java-version: | | |
| 98 | 8 | |
3c78e3a5stainless-app[bot]1 years ago | 99 | 21 |
7a8cd60aStainless Bot2 years ago | 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 | |
cdf6cd11stainless-app[bot]1 years ago | 107 | examples: |
7dbd0f54stainless-app[bot]1 years ago | 108 | timeout-minutes: 10 |
cdf6cd11stainless-app[bot]1 years ago | 109 | name: examples |
3c78e3a5stainless-app[bot]1 years ago | 110 | runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
d8b19b7estainless-app[bot]1 years ago | 111 | if: github.repository == 'openai/openai-java' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) |
cdf6cd11stainless-app[bot]1 years ago | 112 | |
| 113 | steps: | |
de8d6db6stainless-app[bot]6 months ago | 114 | - uses: actions/checkout@v6 |
cdf6cd11stainless-app[bot]1 years ago | 115 | |
| 116 | - name: Set up Java | |
de8d6db6stainless-app[bot]6 months ago | 117 | uses: actions/setup-java@v5 |
cdf6cd11stainless-app[bot]1 years ago | 118 | with: |
| 119 | distribution: temurin | |
| 120 | java-version: | | |
| 121 | 8 | |
3c78e3a5stainless-app[bot]1 years ago | 122 | 21 |
cdf6cd11stainless-app[bot]1 years ago | 123 | cache: gradle |
| 124 | - name: Set up Gradle | |
| 125 | uses: gradle/gradle-build-action@v2 | |
af9f9a27Robert Craigie2 years ago | 126 | |
cdf6cd11stainless-app[bot]1 years ago | 127 | - env: |
| 128 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| 129 | run: | | |
| 130 | ./gradlew :openai-java-example:run |