openai/openai-python

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev/hayden/bedrock-aws-auth

Branches

Tags

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

Clone

HTTPS

Download ZIP

.github/workflows/ci.yml

129lines · modecode

1name: CI
2on:
3 push:
4 branches:
5 - '**'
6 - '!integrated/**'
7 - '!stl-preview-head/**'
8 - '!stl-preview-base/**'
9 - '!generated'
10 - '!codegen/**'
11 - 'codegen/stl/**'
12 pull_request:
13 branches-ignore:
14 - 'stl-preview-head/**'
15 - 'stl-preview-base/**'
16
17jobs:
18 lint:
19 timeout-minutes: 10
20 name: lint
21 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
22 if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
23 steps:
24 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25
26 - name: Set up Rye
27 uses: eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8
28 with:
29 version: '0.44.0'
30 enable-cache: true
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.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
48
49 - name: Set up Rye
50 uses: eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8
51 with:
52 version: '0.44.0'
53 enable-cache: true
54
55 - name: Install dependencies
56 run: rye sync --all-features
57
58 - name: Run build
59 run: rye build
60
61 - name: Validate Bedrock wheel
62 run: rye run python scripts/utils/validate-bedrock-wheel.py
63
64 - name: Get GitHub OIDC Token
65 if: |-
66 github.repository == 'stainless-sdks/openai-python' &&
67 !startsWith(github.ref, 'refs/heads/stl/')
68 id: github-oidc
69 uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
70 with:
71 script: core.setOutput('github_token', await core.getIDToken());
72
73 - name: Upload tarball
74 if: |-
75 github.repository == 'stainless-sdks/openai-python' &&
76 !startsWith(github.ref, 'refs/heads/stl/')
77 env:
78 URL: https://pkg.stainless.com/s
79 AUTH: ${{ steps.github-oidc.outputs.github_token }}
80 SHA: ${{ github.sha }}
81 run: ./scripts/utils/upload-artifact.sh
82
83 test:
84 timeout-minutes: 10
85 name: test
86 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
87 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
88 steps:
89 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
90
91 - name: Set up Rye
92 uses: eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8
93 with:
94 version: '0.44.0'
95 enable-cache: true
96
97 - name: Bootstrap
98 run: ./scripts/bootstrap
99
100 - name: Run tests
101 run: ./scripts/test
102
103 examples:
104 timeout-minutes: 10
105 name: examples
106 environment: ci
107 runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
108 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')
109
110 steps:
111 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
112
113 - name: Set up Rye
114 uses: eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8
115 with:
116 version: '0.44.0'
117 enable-cache: true
118 - name: Install dependencies
119 run: |
120 rye sync --all-features
121
122 - env:
123 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
124 run: |
125 rye run python examples/demo.py
126 - env:
127 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
128 run: |
129 rye run python examples/async_demo.py
130