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