mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
5c992eb7ae
* move all tests under tests and initial work on int tests * added updated tests setup and merge tests * without failing step * fixed upload * updated file names for coverage * reenable surface tests * removed package matrix * simplified variables * correct path * removed mistake * fix mistake in path * fix path * windows specific env set * updated merge tests * slight update in marker * added run integration tests settings * updated setup, moved foundry int tests and updated merge test
189 lines
6.1 KiB
YAML
189 lines
6.1 KiB
YAML
name: Python - Tests - Merge
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
merge_group:
|
|
branches: ["main"]
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: "write"
|
|
|
|
env:
|
|
# Configure a constant location for the uv cache
|
|
UV_CACHE_DIR: /tmp/.uv-cache
|
|
RUN_INTEGRATION_TESTS: "true"
|
|
|
|
jobs:
|
|
python-tests-main:
|
|
name: Python Tests - Main
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
os: [ubuntu-latest]
|
|
env:
|
|
UV_PYTHON: ${{ matrix.python-version }}
|
|
OPENAI_CHAT_MODEL_ID: ${{ vars.OPENAI__CHATMODELID }}
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }}
|
|
PACKAGE_NAME: "main"
|
|
permissions:
|
|
contents: write
|
|
defaults:
|
|
run:
|
|
working-directory: python
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
version: "0.7.x"
|
|
enable-cache: true
|
|
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
|
|
cache-dependency-glob: "**/uv.lock"
|
|
- name: Install the project
|
|
run: |
|
|
uv sync --all-packages --all-extras --dev -U --prerelease=if-necessary-or-explicit
|
|
- name: Test with pytest
|
|
run: uv run poe --directory ./packages/${{ env.PACKAGE_NAME }} test --junitxml=coverage.xml
|
|
working-directory: ./python
|
|
- name: Move coverage file
|
|
run: |
|
|
mv ./packages/${{ env.PACKAGE_NAME }}/coverage.xml coverage_${{ env.PACKAGE_NAME }}.xml
|
|
working-directory: ./python
|
|
- name: Upload coverage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-${{ env.PACKAGE_NAME }}
|
|
path: ./python/coverage_${{ env.PACKAGE_NAME }}.xml
|
|
- name: Surface failing tests
|
|
if: always()
|
|
uses: pmeier/pytest-results-action@v0.7.2
|
|
with:
|
|
path: ./python/**.xml
|
|
summary: true
|
|
display-options: fEX
|
|
fail-on-empty: true
|
|
title: Test results
|
|
|
|
python-tests-azure:
|
|
name: Python Tests - Azure
|
|
runs-on: ${{ matrix.os }}
|
|
environment: "integration"
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
os: [ubuntu-latest]
|
|
env:
|
|
UV_PYTHON: ${{ matrix.python-version }}
|
|
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZUREAI__DEPLOYMENTNAME }}
|
|
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZUREAI__ENDPOINT }}
|
|
PACKAGE_NAME: "azure"
|
|
permissions:
|
|
contents: write
|
|
defaults:
|
|
run:
|
|
working-directory: python
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
version: "0.7.x"
|
|
enable-cache: true
|
|
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
|
|
cache-dependency-glob: "**/uv.lock"
|
|
- name: Install the project
|
|
run: |
|
|
uv sync --all-packages --all-extras --dev -U --prerelease=if-necessary-or-explicit
|
|
- name: Azure CLI Login
|
|
if: github.event_name != 'pull_request'
|
|
uses: azure/login@v2
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
- name: Test with pytest
|
|
run: uv run poe --directory ./packages/${{ env.PACKAGE_NAME }} test --junitxml=coverage.xml
|
|
working-directory: ./python
|
|
- name: Move coverage file
|
|
run: |
|
|
mv ./packages/${{ env.PACKAGE_NAME }}/coverage.xml coverage_${{ env.PACKAGE_NAME }}.xml
|
|
working-directory: ./python
|
|
- name: Upload coverage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-${{ env.PACKAGE_NAME }}
|
|
path: ./python/coverage_${{ env.PACKAGE_NAME }}.xml
|
|
- name: Surface failing tests
|
|
if: always()
|
|
uses: pmeier/pytest-results-action@v0.7.2
|
|
with:
|
|
path: ./python/**.xml
|
|
summary: true
|
|
display-options: fEX
|
|
fail-on-empty: true
|
|
title: Test results
|
|
|
|
python-tests-foundry:
|
|
name: Python Tests - Foundry
|
|
runs-on: ${{ matrix.os }}
|
|
environment: "integration"
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
os: [ubuntu-latest]
|
|
env:
|
|
UV_PYTHON: ${{ matrix.python-version }}
|
|
FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }}
|
|
FOUNDRY_MODEL_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MODEL_DEPLOYMENT_NAME }}
|
|
PACKAGE_NAME: "foundry"
|
|
permissions:
|
|
contents: write
|
|
defaults:
|
|
run:
|
|
working-directory: python
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
version: "0.7.x"
|
|
enable-cache: true
|
|
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
|
|
cache-dependency-glob: "**/uv.lock"
|
|
- name: Install the project
|
|
run: |
|
|
uv sync --all-packages --all-extras --dev -U --prerelease=if-necessary-or-explicit
|
|
- name: Azure CLI Login
|
|
if: github.event_name != 'pull_request'
|
|
uses: azure/login@v2
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
- name: Test with pytest
|
|
run: uv run poe --directory ./packages/${{ env.PACKAGE_NAME }} test --junitxml=coverage.xml
|
|
working-directory: ./python
|
|
- name: Move coverage file
|
|
run: |
|
|
mv ./packages/${{ env.PACKAGE_NAME }}/coverage.xml coverage_${{ env.PACKAGE_NAME }}.xml
|
|
working-directory: ./python
|
|
- name: Upload coverage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-${{ env.PACKAGE_NAME }}
|
|
path: ./python/coverage_${{ env.PACKAGE_NAME }}.xml
|
|
- name: Surface failing tests
|
|
if: always()
|
|
uses: pmeier/pytest-results-action@v0.7.2
|
|
with:
|
|
path: ./python/**.xml
|
|
summary: true
|
|
display-options: fEX
|
|
fail-on-empty: true
|
|
title: Test results
|