11name : CI
22on :
33 push :
4- branches :
5- - main
4+ branches-ignore :
5+ - ' generated'
6+ - ' codegen/**'
7+ - ' integrated/**'
8+ - ' stl-preview-head/**'
9+ - ' stl-preview-base/**'
610 pull_request :
7- branches :
8- - main
11+ branches-ignore :
12+ - ' stl-preview-head/**'
13+ - ' stl-preview-base/**'
914
1015jobs :
1116 lint :
17+ timeout-minutes : 10
1218 name : lint
13- runs-on : ubuntu-latest
14- if : github.repository == 'openai/openai-python'
15-
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
1621 steps :
1722 - uses : actions/checkout@v4
1823
2126 curl -sSf https://rye.astral.sh/get | bash
2227 echo "$HOME/.rye/shims" >> $GITHUB_PATH
2328 env :
24- RYE_VERSION : ' 0.35 .0'
29+ RYE_VERSION : ' 0.44 .0'
2530 RYE_INSTALL_OPTION : ' --yes'
2631
2732 - name : Install dependencies
@@ -30,11 +35,51 @@ jobs:
3035 - name : Run lints
3136 run : ./scripts/lint
3237
38+ build :
39+ if : 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 : ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
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+ if : github.repository == 'stainless-sdks/openai-python'
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
71+ if : github.repository == 'stainless-sdks/openai-python'
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+
3378 test :
79+ timeout-minutes : 10
3480 name : test
35- runs-on : ubuntu-latest
36- if : github.repository == 'openai/openai-python'
37-
81+ runs-on : ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
82+ if : github.event_name == 'push' || github.event.pull_request.head.repo.fork
3883 steps :
3984 - uses : actions/checkout@v4
4085
@@ -43,11 +88,40 @@ jobs:
4388 curl -sSf https://rye.astral.sh/get | bash
4489 echo "$HOME/.rye/shims" >> $GITHUB_PATH
4590 env :
46- RYE_VERSION : ' 0.35 .0'
91+ RYE_VERSION : ' 0.44 .0'
4792 RYE_INSTALL_OPTION : ' --yes'
4893
4994 - name : Bootstrap
5095 run : ./scripts/bootstrap
5196
5297 - name : Run tests
5398 run : ./scripts/test
99+
100+ examples :
101+ timeout-minutes : 10
102+ name : examples
103+ runs-on : ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
104+ if : github.repository == 'openai/openai-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
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 :
114+ RYE_VERSION : ' 0.44.0'
115+ RYE_INSTALL_OPTION : ' --yes'
116+ - name : Install dependencies
117+ run : |
118+ rye sync --all-features
119+
120+ - env :
121+ OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
122+ run : |
123+ rye run python examples/demo.py
124+ - env :
125+ OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
126+ run : |
127+ rye run python examples/async_demo.py
0 commit comments