mirror of
https://github.com/microsoft/autogen.git
synced 2026-02-08 22:45:16 -05:00
* test permissions * test least permissions * remove contents permissions * testing permisions * Update deploy-website.yml permission block --------- Co-authored-by: Davor Runje <davor@airt.ai> Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> Co-authored-by: Chi Wang <wang.chi@microsoft.com>
85 lines
2.8 KiB
YAML
85 lines
2.8 KiB
YAML
# This workflow will install Python dependencies and run tests with a variety of Python versions
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
name: OpenAI
|
|
|
|
on:
|
|
pull_request_target:
|
|
branches: ["main"]
|
|
paths:
|
|
- "autogen/**"
|
|
- "test/**"
|
|
- "notebook/agentchat_auto_feedback_from_code_execution.ipynb"
|
|
- "notebook/agentchat_function_call.ipynb"
|
|
- ".github/workflows/openai.yml"
|
|
permissions: {}
|
|
# actions: read
|
|
# checks: read
|
|
# contents: read
|
|
# deployments: read
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
services:
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- 6379:6379
|
|
options: --entrypoint redis-server
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e.
|
|
python -c "import autogen"
|
|
pip install coverage pytest-asyncio
|
|
- name: Install packages for test when needed
|
|
if: matrix.python-version == '3.9'
|
|
run: |
|
|
pip install docker
|
|
pip install -e .[redis]
|
|
- name: Coverage
|
|
if: matrix.python-version == '3.9'
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
coverage run -a -m pytest test --ignore=test/agentchat/contrib
|
|
coverage xml
|
|
- name: Coverage and check notebook outputs
|
|
if: matrix.python-version != '3.9'
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
WOLFRAM_ALPHA_APPID: ${{ secrets.WOLFRAM_ALPHA_APPID }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pip install nbconvert nbformat ipykernel
|
|
coverage run -a -m pytest test/test_notebook.py
|
|
coverage xml
|
|
cat "$(pwd)/test/executed_openai_notebook_output.txt"
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|