adding unittests for refactored functions #134
Workflow file for this run
This file contains hidden or 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
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: LicenseRef-NvidiaProprietary | |
| # | |
| # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual | |
| # property and proprietary rights in and to this material, related | |
| # documentation and any modifications thereto. Any use, reproduction, | |
| # disclosure or distribution of this material and related documentation | |
| # without an express license agreement from NVIDIA CORPORATION or | |
| # its affiliates is strictly prohibited. | |
| name: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - "pull-request/[0-9]+" | |
| merge_group: | |
| types: | |
| - checks_requested | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PIP_NO_CACHE_DIR: "1" | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| PIP_PREFER_BINARY: "1" | |
| jobs: | |
| yapf-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install yapf | |
| - run: yapf --diff --recursive code/ | |
| spdx-header-check: | |
| runs-on: linux-amd64-cpu4 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: python3 code/scripts/spdx_headers.py --check | |
| unit-tests: | |
| runs-on: linux-amd64-cpu4 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| name: "unit-tests / py${{ matrix.python-version }}" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies and run tests | |
| run: bash code/scripts/check_python_compat.sh | |
| env: | |
| PYTHON_BIN: python | |
| MODE: inference | |
| SKIP_TESTS: "0" | |
| PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu" | |
| unit-tests-coverage: | |
| runs-on: linux-amd64-cpu4 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| pip install -r code/requirements_public_inference.txt \ | |
| --extra-index-url https://download.pytorch.org/whl/cpu | |
| pip install -r code/requirements_ci.txt | |
| - name: Run tests with coverage | |
| run: | | |
| PYTHONPATH=code coverage run -m unittest discover -s code/tests -p "test_*.py" | |
| coverage report | |
| coverage html -d htmlcov | |
| coverage xml -o coverage.xml | |
| - name: Upload coverage artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: | | |
| htmlcov/ | |
| coverage.xml |