Skip to content

Add CI workflow to run fast tests with onnx-light==0.1.1 #885

Add CI workflow to run fast tests with onnx-light==0.1.1

Add CI workflow to run fast tests with onnx-light==0.1.1 #885

Workflow file for this run

name: Fast Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
tests:
name: ci (${{ matrix.os }}, py${{ matrix.python-version }}, torch-${{ matrix.torch.version || 'stable' }}, transformers-${{ matrix.transformers-version || 'latest' }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.13"]
transformers-version: ["4.57", "5.6", "5.12.1"]
torch:
- version: "2.12.0"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
# we install torch first to avoid downloading any CUDA dependency
- name: Install nightly pytorch
if: matrix.torch.version == 'nightly'
run: pip install --pre --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
- name: Install pytorch ${{ matrix.torch.version }} (Linux/Windows)
if: matrix.torch.version != 'nightly' && matrix.os != 'macos-latest'
run: pip install "torch==${{ matrix.torch.version }}+cpu" torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- name: Install dependencies
run: pip install -e ".[dev]" torch "transformers==${{ matrix.transformers-version }}" tokenizers
- name: pip freeze
run: pip freeze
- name: Run fast tests
run: DOCLEAN=1&&pytest tests/fast -v --cov=modelbuilder --cov-report=xml --cov-report=term-missing
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: fast-tests
- name: Upload stats artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: stats-${{ matrix.os }}-py${{ matrix.python-version }}-torch${{ matrix.torch.version }}-transformers${{ matrix.transformers-version }}
path: stats/
if-no-files-found: ignore