openai/openai-python
Publicmirrored fromhttps://github.com/openai/openai-pythonAvailable
.github/workflows/ci.yml
80lines · modecode
| 1 | name: CI |
| 2 | on: |
| 3 | push: |
| 4 | branches: |
| 5 | - main |
| 6 | pull_request: |
| 7 | branches: |
| 8 | - main |
| 9 | |
| 10 | jobs: |
| 11 | lint: |
| 12 | name: lint |
| 13 | runs-on: ubuntu-latest |
| 14 | if: github.repository == 'openai/openai-python' |
| 15 | |
| 16 | steps: |
| 17 | - uses: actions/checkout@v4 |
| 18 | |
| 19 | - name: Install Rye |
| 20 | run: | |
| 21 | curl -sSf https://rye.astral.sh/get | bash |
| 22 | echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 23 | env: |
| 24 | RYE_VERSION: '0.35.0' |
| 25 | RYE_INSTALL_OPTION: '--yes' |
| 26 | |
| 27 | - name: Install dependencies |
| 28 | run: rye sync --all-features |
| 29 | |
| 30 | - name: Run lints |
| 31 | run: ./scripts/lint |
| 32 | |
| 33 | test: |
| 34 | name: test |
| 35 | runs-on: ubuntu-latest |
| 36 | if: github.repository == 'openai/openai-python' |
| 37 | |
| 38 | steps: |
| 39 | - uses: actions/checkout@v4 |
| 40 | |
| 41 | - name: Install Rye |
| 42 | run: | |
| 43 | curl -sSf https://rye.astral.sh/get | bash |
| 44 | echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 45 | env: |
| 46 | RYE_VERSION: '0.35.0' |
| 47 | RYE_INSTALL_OPTION: '--yes' |
| 48 | |
| 49 | - name: Bootstrap |
| 50 | run: ./scripts/bootstrap |
| 51 | |
| 52 | - name: Run tests |
| 53 | run: ./scripts/test |
| 54 | |
| 55 | examples: |
| 56 | name: examples |
| 57 | runs-on: ubuntu-latest |
| 58 | |
| 59 | steps: |
| 60 | - uses: actions/checkout@v4 |
| 61 | |
| 62 | - name: Install Rye |
| 63 | run: | |
| 64 | curl -sSf https://rye.astral.sh/get | bash |
| 65 | echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 66 | env: |
| 67 | RYE_VERSION: '0.35.0' |
| 68 | RYE_INSTALL_OPTION: '--yes' |
| 69 | - name: Install dependencies |
| 70 | run: | |
| 71 | rye sync --all-features |
| 72 | |
| 73 | - env: |
| 74 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 75 | run: | |
| 76 | rye run python examples/demo.py |
| 77 | - env: |
| 78 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 79 | run: | |
| 80 | rye run python examples/async_demo.py |
| 81 | |