openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
.github/workflows/ci.yml
105lines · modeblame
08b8179aDavid Schnurr2 years ago | 1 | name: CI |
| 2 | on: | |
| 3 | push: | |
c1ceebbdstainless-app[bot]1 years ago | 4 | branches-ignore: |
| 5 | - 'generated' | |
| 6 | - 'codegen/**' | |
| 7 | - 'integrated/**' | |
| 8 | - 'stl-preview-head/**' | |
| 9 | - 'stl-preview-base/**' | |
08b8179aDavid Schnurr2 years ago | 10 | |
| 11 | jobs: | |
| 12 | lint: | |
271d979astainless-app[bot]1 years ago | 13 | timeout-minutes: 10 |
08b8179aDavid Schnurr2 years ago | 14 | name: lint |
c9cedd8astainless-app[bot]1 years ago | 15 | runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
08b8179aDavid Schnurr2 years ago | 16 | steps: |
f0b18239Stainless Bot2 years ago | 17 | - uses: actions/checkout@v4 |
08b8179aDavid Schnurr2 years ago | 18 | |
| 19 | - name: Install Rye | |
| 20 | run: | | |
001965beStainless Bot2 years ago | 21 | curl -sSf https://rye.astral.sh/get | bash |
08b8179aDavid Schnurr2 years ago | 22 | echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 23 | env: | |
d664ff22stainless-app[bot]1 years ago | 24 | RYE_VERSION: '0.44.0' |
b36b8d86Stainless Bot2 years ago | 25 | RYE_INSTALL_OPTION: '--yes' |
08b8179aDavid Schnurr2 years ago | 26 | |
| 27 | - name: Install dependencies | |
526a05ebStainless Bot2 years ago | 28 | run: rye sync --all-features |
08b8179aDavid Schnurr2 years ago | 29 | |
526a05ebStainless Bot2 years ago | 30 | - name: Run lints |
| 31 | run: ./scripts/lint | |
27d0e67bstainless-app[bot]1 years ago | 32 | |
98925cefstainless-app[bot]1 years ago | 33 | upload: |
| 34 | if: github.repository == 'stainless-sdks/openai-python' | |
| 35 | timeout-minutes: 10 | |
| 36 | name: upload | |
| 37 | permissions: | |
| 38 | contents: read | |
| 39 | id-token: write | |
| 40 | runs-on: depot-ubuntu-24.04 | |
| 41 | steps: | |
| 42 | - uses: actions/checkout@v4 | |
| 43 | | |
| 44 | - name: Get GitHub OIDC Token | |
| 45 | id: github-oidc | |
| 46 | uses: actions/github-script@v6 | |
| 47 | with: | |
| 48 | script: core.setOutput('github_token', await core.getIDToken()); | |
| 49 | | |
| 50 | - name: Upload tarball | |
| 51 | env: | |
| 52 | URL: https://pkg.stainless.com/s | |
| 53 | AUTH: ${{ steps.github-oidc.outputs.github_token }} | |
| 54 | SHA: ${{ github.sha }} | |
| 55 | run: ./scripts/utils/upload-artifact.sh | |
| 56 | | |
d2738d42Stainless Bot2 years ago | 57 | test: |
271d979astainless-app[bot]1 years ago | 58 | timeout-minutes: 10 |
d2738d42Stainless Bot2 years ago | 59 | name: test |
c9cedd8astainless-app[bot]1 years ago | 60 | runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
d2738d42Stainless Bot2 years ago | 61 | steps: |
| 62 | - uses: actions/checkout@v4 | |
| 63 | | |
| 64 | - name: Install Rye | |
| 65 | run: | | |
001965beStainless Bot2 years ago | 66 | curl -sSf https://rye.astral.sh/get | bash |
d2738d42Stainless Bot2 years ago | 67 | echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 68 | env: | |
d664ff22stainless-app[bot]1 years ago | 69 | RYE_VERSION: '0.44.0' |
d2738d42Stainless Bot2 years ago | 70 | RYE_INSTALL_OPTION: '--yes' |
| 71 | | |
| 72 | - name: Bootstrap | |
| 73 | run: ./scripts/bootstrap | |
| 74 | | |
| 75 | - name: Run tests | |
| 76 | run: ./scripts/test | |
b31f4d4cstainless-app[bot]1 years ago | 77 | |
| 78 | examples: | |
271d979astainless-app[bot]1 years ago | 79 | timeout-minutes: 10 |
b31f4d4cstainless-app[bot]1 years ago | 80 | name: examples |
c9cedd8astainless-app[bot]1 years ago | 81 | runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
a7642537stainless-app[bot]1 years ago | 82 | if: github.repository == 'openai/openai-python' |
b31f4d4cstainless-app[bot]1 years ago | 83 | |
| 84 | steps: | |
| 85 | - uses: actions/checkout@v4 | |
| 86 | | |
| 87 | - name: Install Rye | |
| 88 | run: | | |
| 89 | curl -sSf https://rye.astral.sh/get | bash | |
| 90 | echo "$HOME/.rye/shims" >> $GITHUB_PATH | |
| 91 | env: | |
d664ff22stainless-app[bot]1 years ago | 92 | RYE_VERSION: '0.44.0' |
b31f4d4cstainless-app[bot]1 years ago | 93 | RYE_INSTALL_OPTION: '--yes' |
| 94 | - name: Install dependencies | |
| 95 | run: | | |
| 96 | rye sync --all-features | |
| 97 | | |
| 98 | - env: | |
| 99 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| 100 | run: | | |
| 101 | rye run python examples/demo.py | |
| 102 | - env: | |
| 103 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| 104 | run: | | |
| 105 | rye run python examples/async_demo.py |