openai/openai-python

Public

mirrored fromhttps://github.com/openai/openai-pythonAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.97.2

Branches

Tags

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

Clone

HTTPS

Download ZIP

.github/workflows/ci.yml

125lines · modecode

1name: CI
2on:
3 push:
4 branches-ignore:
5 - 'generated'
6 - 'codegen/**'
7 - 'integrated/**'
8 - 'stl-preview-head/**'
9 - 'stl-preview-base/**'
10 pull_request:
11 branches-ignore:
12 - 'stl-preview-head/**'
13 - 'stl-preview-base/**'
14
15jobs:
16 lint:
17 timeout-minutes: 10
18 name: lint
19 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
21 steps:
22 - uses: actions/checkout@v4
23
24 - name: Install Rye
25 run: |
26 curl -sSf https://rye.astral.sh/get | bash
27 echo "$HOME/.rye/shims" >> $GITHUB_PATH
28 env:
29 RYE_VERSION: '0.44.0'
30 RYE_INSTALL_OPTION: '--yes'
31
32 - name: Install dependencies
33 run: rye sync --all-features
34
35 - name: Run lints
36 run: ./scripts/lint
37
38 build:
39 if: github.repository == 'stainless-sdks/openai-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
40 timeout-minutes: 10
41 name: build
42 permissions:
43 contents: read
44 id-token: write
45 runs-on: depot-ubuntu-24.04
46 steps:
47 - uses: actions/checkout@v4
48
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
63 - name: Get GitHub OIDC Token
64 id: github-oidc
65 uses: actions/github-script@v6
66 with:
67 script: core.setOutput('github_token', await core.getIDToken());
68
69 - name: Upload tarball
70 env:
71 URL: https://pkg.stainless.com/s
72 AUTH: ${{ steps.github-oidc.outputs.github_token }}
73 SHA: ${{ github.sha }}
74 run: ./scripts/utils/upload-artifact.sh
75
76 test:
77 timeout-minutes: 10
78 name: test
79 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
80 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
81 steps:
82 - uses: actions/checkout@v4
83
84 - name: Install Rye
85 run: |
86 curl -sSf https://rye.astral.sh/get | bash
87 echo "$HOME/.rye/shims" >> $GITHUB_PATH
88 env:
89 RYE_VERSION: '0.44.0'
90 RYE_INSTALL_OPTION: '--yes'
91
92 - name: Bootstrap
93 run: ./scripts/bootstrap
94
95 - name: Run tests
96 run: ./scripts/test
97
98 examples:
99 timeout-minutes: 10
100 name: examples
101 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
102 if: github.repository == 'openai/openai-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
103
104 steps:
105 - uses: actions/checkout@v4
106
107 - name: Install Rye
108 run: |
109 curl -sSf https://rye.astral.sh/get | bash
110 echo "$HOME/.rye/shims" >> $GITHUB_PATH
111 env:
112 RYE_VERSION: '0.44.0'
113 RYE_INSTALL_OPTION: '--yes'
114 - name: Install dependencies
115 run: |
116 rye sync --all-features
117
118 - env:
119 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
120 run: |
121 rye run python examples/demo.py
122 - env:
123 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
124 run: |
125 rye run python examples/async_demo.py