mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-23 04:02:25 +00:00
Add coverage badge to README
This commit is contained in:
parent
f85189022c
commit
1303f166fe
5 changed files with 104 additions and 2 deletions
15
.github/workflows/unit-tests.yml
vendored
15
.github/workflows/unit-tests.yml
vendored
|
|
@ -36,7 +36,7 @@ jobs:
|
|||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
PYTHON_VERSION=${{ matrix.python }} ./scripts/unit-tests.sh --cov=llama_stack --junitxml=pytest-report-${{ matrix.python }}.xml --cov-report=html:htmlcov-${{ matrix.python }}
|
||||
PYTHON_VERSION=${{ matrix.python }} ./scripts/unit-tests.sh --junitxml=pytest-report-${{ matrix.python }}.xml
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
|
|
@ -48,3 +48,16 @@ jobs:
|
|||
pytest-report-${{ matrix.python }}.xml
|
||||
htmlcov-${{ matrix.python }}/
|
||||
retention-days: 7
|
||||
|
||||
- name: Check coverage
|
||||
run: |
|
||||
coverage=$(uv run --python $PYTHON_VERSION coverage report -m | tail -1 | tail -c 4 | head -c 2)
|
||||
echo "Total coverage: ${coverage}%"
|
||||
|
||||
# Check if coverage is below the threshold
|
||||
if (( ${coverage} < 40 )); then
|
||||
echo "Coverage failed at ${coverage}%, expected at least 40%"
|
||||
exit 1
|
||||
else
|
||||
echo "Coverage passed, ${coverage}%"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue