openai/openai-python

Public

mirrored from https://github.com/openai/openai-pythonAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.31.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/ci.yml

133lines · modeblame

08b8179aDavid Schnurr2 years ago1name: CI
2on:
3push:
cf8e9e7bstainless-app[bot]3 months ago4branches:
5- '**'
6- '!integrated/**'
7- '!stl-preview-head/**'
8- '!stl-preview-base/**'
9- '!generated'
10- '!codegen/**'
11- 'codegen/stl/**'
ec6532a7stainless-app[bot]1 years ago12pull_request:
13branches-ignore:
14- 'stl-preview-head/**'
15- 'stl-preview-base/**'
08b8179aDavid Schnurr2 years ago16
17jobs:
18lint:
271d979astainless-app[bot]1 years ago19timeout-minutes: 10
08b8179aDavid Schnurr2 years ago20name: lint
c9cedd8astainless-app[bot]1 years ago21runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
23bc0270stainless-app[bot]3 months ago22if: (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 ago23steps:
58184ad5Drew Hintz3 months ago24- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
08b8179aDavid Schnurr2 years ago25
26- name: Install Rye
27run: |
001965beStainless Bot2 years ago28curl -sSf https://rye.astral.sh/get | bash
08b8179aDavid Schnurr2 years ago29echo "$HOME/.rye/shims" >> $GITHUB_PATH
30env:
d664ff22stainless-app[bot]1 years ago31RYE_VERSION: '0.44.0'
b36b8d86Stainless Bot2 years ago32RYE_INSTALL_OPTION: '--yes'
08b8179aDavid Schnurr2 years ago33
34- name: Install dependencies
526a05ebStainless Bot2 years ago35run: rye sync --all-features
08b8179aDavid Schnurr2 years ago36
526a05ebStainless Bot2 years ago37- name: Run lints
38run: ./scripts/lint
27d0e67bstainless-app[bot]1 years ago39
be1f58f0stainless-app[bot]1 years ago40build:
23bc0270stainless-app[bot]3 months ago41if: (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 ago42timeout-minutes: 10
be1f58f0stainless-app[bot]1 years ago43name: build
98925cefstainless-app[bot]1 years ago44permissions:
45contents: read
46id-token: write
9fd9df51stainless-app[bot]10 months ago47runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
98925cefstainless-app[bot]1 years ago48steps:
58184ad5Drew Hintz3 months ago49- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
98925cefstainless-app[bot]1 years ago50
be1f58f0stainless-app[bot]1 years ago51- name: Install Rye
52run: |
53curl -sSf https://rye.astral.sh/get | bash
54echo "$HOME/.rye/shims" >> $GITHUB_PATH
55env:
56RYE_VERSION: '0.44.0'
57RYE_INSTALL_OPTION: '--yes'
58
59- name: Install dependencies
60run: rye sync --all-features
61
62- name: Run build
63run: rye build
64
98925cefstainless-app[bot]1 years ago65- name: Get GitHub OIDC Token
0a4ca536stainless-app[bot]3 months ago66if: |-
67github.repository == 'stainless-sdks/openai-python' &&
68!startsWith(github.ref, 'refs/heads/stl/')
98925cefstainless-app[bot]1 years ago69id: github-oidc
58184ad5Drew Hintz3 months ago70uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
98925cefstainless-app[bot]1 years ago71with:
72script: core.setOutput('github_token', await core.getIDToken());
73
74- name: Upload tarball
0a4ca536stainless-app[bot]3 months ago75if: |-
76github.repository == 'stainless-sdks/openai-python' &&
77!startsWith(github.ref, 'refs/heads/stl/')
98925cefstainless-app[bot]1 years ago78env:
79URL: https://pkg.stainless.com/s
80AUTH: ${{ steps.github-oidc.outputs.github_token }}
81SHA: ${{ github.sha }}
82run: ./scripts/utils/upload-artifact.sh
83
d2738d42Stainless Bot2 years ago84test:
271d979astainless-app[bot]1 years ago85timeout-minutes: 10
d2738d42Stainless Bot2 years ago86name: test
c9cedd8astainless-app[bot]1 years ago87runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
b106b6e5stainless-app[bot]1 years ago88if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
d2738d42Stainless Bot2 years ago89steps:
58184ad5Drew Hintz3 months ago90- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
d2738d42Stainless Bot2 years ago91
92- name: Install Rye
93run: |
001965beStainless Bot2 years ago94curl -sSf https://rye.astral.sh/get | bash
d2738d42Stainless Bot2 years ago95echo "$HOME/.rye/shims" >> $GITHUB_PATH
96env:
d664ff22stainless-app[bot]1 years ago97RYE_VERSION: '0.44.0'
d2738d42Stainless Bot2 years ago98RYE_INSTALL_OPTION: '--yes'
99
100- name: Bootstrap
101run: ./scripts/bootstrap
102
103- name: Run tests
104run: ./scripts/test
b31f4d4cstainless-app[bot]1 years ago105
106examples:
271d979astainless-app[bot]1 years ago107timeout-minutes: 10
b31f4d4cstainless-app[bot]1 years ago108name: examples
c9cedd8astainless-app[bot]1 years ago109runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
23bc0270stainless-app[bot]3 months ago110if: 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 ago111
112steps:
58184ad5Drew Hintz3 months ago113- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
b31f4d4cstainless-app[bot]1 years ago114
115- name: Install Rye
116run: |
117curl -sSf https://rye.astral.sh/get | bash
118echo "$HOME/.rye/shims" >> $GITHUB_PATH
119env:
d664ff22stainless-app[bot]1 years ago120RYE_VERSION: '0.44.0'
b31f4d4cstainless-app[bot]1 years ago121RYE_INSTALL_OPTION: '--yes'
122- name: Install dependencies
123run: |
124rye sync --all-features
125
52b183d5stainless-app[bot]1 years ago126- env:
b31f4d4cstainless-app[bot]1 years ago127OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
128run: |
129rye run python examples/demo.py
52b183d5stainless-app[bot]1 years ago130- env:
b31f4d4cstainless-app[bot]1 years ago131OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
132run: |
133rye run python examples/async_demo.py