openai/openai-python

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.92.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

.github/workflows/ci.yml

109lines · 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 steps:
21 - uses: actions/checkout@v4
22
23 - name: Install Rye
24 run: |
25 curl -sSf https://rye.astral.sh/get | bash
26 echo "$HOME/.rye/shims" >> $GITHUB_PATH
27 env:
28 RYE_VERSION: '0.44.0'
29 RYE_INSTALL_OPTION: '--yes'
30
31 - name: Install dependencies
32 run: rye sync --all-features
33
34 - name: Run lints
35 run: ./scripts/lint
36
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
61 test:
62 timeout-minutes: 10
63 name: test
64 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
65 steps:
66 - uses: actions/checkout@v4
67
68 - name: Install Rye
69 run: |
70 curl -sSf https://rye.astral.sh/get | bash
71 echo "$HOME/.rye/shims" >> $GITHUB_PATH
72 env:
73 RYE_VERSION: '0.44.0'
74 RYE_INSTALL_OPTION: '--yes'
75
76 - name: Bootstrap
77 run: ./scripts/bootstrap
78
79 - name: Run tests
80 run: ./scripts/test
81
82 examples:
83 timeout-minutes: 10
84 name: examples
85 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
86 if: github.repository == 'openai/openai-python'
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:
96 RYE_VERSION: '0.44.0'
97 RYE_INSTALL_OPTION: '--yes'
98 - name: Install dependencies
99 run: |
100 rye sync --all-features
101
102 - env:
103 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
104 run: |
105 rye run python examples/demo.py
106 - env:
107 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
108 run: |
109 rye run python examples/async_demo.py
110