Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ env:

jobs:
lint-and-test:
permissions:
contents: read
code-quality: write
strategy:
fail-fast: false
matrix:
Expand All @@ -24,6 +27,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Test the PR head rather than the merge commit so coverage lines map onto the PR diff
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Setup Python with UV
uses: $/.github/actions/setup-python-uv
Expand All @@ -37,7 +43,16 @@ jobs:
RUFF_OUTPUT_FORMAT: github

- name: Run tests with coverage
run: uv run pytest --cov=src/bcbench --cov=packages/bcbench-core/src/bcbench_core --cov-report=term-missing
run: uv run pytest --cov --cov-report=term-missing --cov-report=xml

- name: Upload coverage to GitHub Code Quality
# main pushes set the baseline and same-repo PRs are compared to it; other runs (forks, dispatch) cannot upload
if: matrix.os == 'ubuntu-latest' && ((github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository))
uses: actions/upload-code-coverage@2b21a77928be8d5168c2b9581a67f2adbebacc52 # v1.4.4
with:
file: coverage.xml
language: Python
label: code-coverage/pytest

e2e:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ uv run bcbench --help
uv run bcbench run copilot microsoft__BCApps-5633 --category bug-fix --repo-path /path/to/BCApps

# Run tests (bcbench and bcbench-core)
uv run pytest --cov=src/bcbench --cov=packages/bcbench-core/src/bcbench_core --cov-report=term-missing
uv run pytest --cov --cov-report=term-missing

# Lint and format
uv run pre-commit run --all-files
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ markers = [
]
collect_imported_tests = false

[tool.coverage.run]
# Repo-relative paths in coverage.xml so GitHub Code Quality can map them onto PR files
relative_files = true
include = ["src/bcbench/*", "packages/bcbench-core/src/bcbench_core/*"]

[tool.ruff]
# The app inherits the bcbench-core lint baseline; tables redefined below replace the inherited ones.
extend = "packages/bcbench-core/pyproject.toml"
Expand Down
Loading