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