Coverage Test #369
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage Test | |
on: | |
workflow_dispatch: # Allow manual triggers | |
schedule: | |
- cron: 0 0 * * * | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 80 | |
env: | |
COVERAGE_THRESHOLD: 97 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Python 3 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install coverage | |
- name: Prepare TF env | |
run: pip install tensorflow==2.13.* | |
- name: Run tensorflow testsuite | |
run: coverage run --parallel-mode -m --omit "*__init__.py" --include "model_compression_toolkit/**/*.py" unittest tests/test_suite.py -v | |
- name: Prepare Torch env | |
run: pip uninstall tensorflow -y && pip install torch==2.0.* torchvision onnx onnxruntime onnxruntime-extensions | |
- name: Run torch testsuite | |
run: coverage run --parallel-mode -m --omit "*__init__.py" --include "model_compression_toolkit/**/*.py" unittest tests/test_suite.py -v | |
- name: Combine Multiple Coverage Files | |
run: coverage combine | |
- name: Run Coverage HTML | |
run: coverage html -i --directory ./coverage_report_html | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: | | |
coverage_report_html | |
- name: Coverage Report | |
run: coverage report -i --skip-covered --sort cover --fail-under $COVERAGE_THRESHOLD |