mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Small update to test coverage workflow, to retrigger based on workflow run. Small updates to samples notebooks, to use GLOBAL_LLM_SERVICE allowing control of where they run through env. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
69 lines
2.4 KiB
YAML
69 lines
2.4 KiB
YAML
name: Python Test Coverage
|
|
|
|
on:
|
|
pull_request_target:
|
|
branches: ["main", "feature*"]
|
|
paths:
|
|
- "python/**"
|
|
workflow_run:
|
|
workflows: ["Python Unit Tests"]
|
|
types:
|
|
- in_progress
|
|
|
|
jobs:
|
|
python-tests-coverage:
|
|
name: Create Test Coverage Messages
|
|
runs-on: ${{ matrix.os }}
|
|
permissions:
|
|
pull-requests: write
|
|
contents: read
|
|
actions: read
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
os: [ubuntu-latest]
|
|
steps:
|
|
- name: Wait for unit tests to succeed
|
|
continue-on-error: true
|
|
uses: lewagon/[email protected]
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
check-name: 'Python Unit Tests (${{ matrix.python-version}}, ${{ matrix.os }})'
|
|
repo-token: ${{ secrets.GH_ACTIONS_PR_WRITE }}
|
|
wait-interval: 10
|
|
allowed-conclusions: success
|
|
- uses: actions/checkout@v4
|
|
- name: Download coverage
|
|
continue-on-error: true
|
|
uses: dawidd6/action-download-artifact@v3
|
|
with:
|
|
name: python-coverage-${{ matrix.os }}-${{ matrix.python-version }}.txt
|
|
github_token: ${{ secrets.GH_ACTIONS_PR_WRITE }}
|
|
workflow: python-unit-tests.yml
|
|
search_artifacts: true
|
|
if_no_artifact_found: warn
|
|
- name: Download pytest
|
|
continue-on-error: true
|
|
uses: dawidd6/action-download-artifact@v3
|
|
with:
|
|
name: pytest-${{ matrix.os }}-${{ matrix.python-version }}.xml
|
|
github_token: ${{ secrets.GH_ACTIONS_PR_WRITE }}
|
|
workflow: python-unit-tests.yml
|
|
search_artifacts: true
|
|
if_no_artifact_found: warn
|
|
- name: Pytest coverage comment
|
|
continue-on-error: true
|
|
id: coverageComment
|
|
uses: MishaKav/pytest-coverage-comment@main
|
|
with:
|
|
github-token: ${{ secrets.GH_ACTIONS_PR_WRITE }}
|
|
pytest-coverage-path: python-coverage-${{ matrix.os }}-${{ matrix.python-version }}.txt
|
|
coverage-path-prefix: "python/"
|
|
title: "Python ${{ matrix.python-version }} Test Coverage Report"
|
|
badge-title: "Py${{ matrix.python-version }} Test Coverage"
|
|
report-only-changed-files: true
|
|
junitxml-title: "Python ${{ matrix.python-version }} Unit Test Overview"
|
|
junitxml-path: pytest-${{ matrix.os }}-${{ matrix.python-version }}.xml
|
|
default-branch: "main"
|
|
unique-id-for-comment: python-${{ matrix.python-version }}
|