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