Skip to content

Commit

Permalink
Merge pull request foundation-model-stack#171 from tedhtchang/test-co…
Browse files Browse the repository at this point in the history
…verage

Add test coverage
  • Loading branch information
anhuong authored Jun 17, 2024
2 parents 087e0c4 + 34e0ae1 commit fc87c74
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Coverage
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Check Coverage
run: tox -e coverage
15 changes: 15 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,18 @@ deps =
twine
commands = twine check dist/*
skip_install = True

[testenv:coverage]
description = report unit test coverage
deps =
coverage
pytest
genbadge[coverage]
commands =
coverage run \
--omit=*/_version.py,*/launch_training.py \
--source=tuning,build \
--module pytest tests/
coverage report -m
coverage xml
genbadge coverage -s -i coverage.xml

0 comments on commit fc87c74

Please sign in to comment.