[pre-commit.ci] pre-commit autoupdate #522
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: Python package | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
pytorch-version: ["1.4.0", "1.5.1", "1.6.0", "1.7.1", "1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "2.0", "2.1", "2.2"] | |
include: | |
- python-version: 3.11 | |
pytorch-version: 2.0 | |
- python-version: 3.11 | |
pytorch-version: 2.1 | |
- python-version: 3.11 | |
pytorch-version: 2.2 | |
exclude: | |
- python-version: 3.8 | |
pytorch-version: 1.7.1 | |
- python-version: 3.9 | |
pytorch-version: 1.4.0 | |
- python-version: 3.9 | |
pytorch-version: 1.5.1 | |
- python-version: 3.9 | |
pytorch-version: 1.6.0 | |
- python-version: 3.9 | |
pytorch-version: 1.7.1 | |
- python-version: 3.9 | |
pytorch-version: 1.8 | |
- python-version: 3.10 | |
pytorch-version: 1.4.0 | |
- python-version: 3.10 | |
pytorch-version: 1.5.1 | |
- python-version: 3.10 | |
pytorch-version: 1.6.0 | |
- python-version: 3.10 | |
pytorch-version: 1.7.1 | |
- python-version: 3.10 | |
pytorch-version: 1.8 | |
- python-version: 3.10 | |
pytorch-version: 1.6.0 | |
- python-version: 3.10 | |
pytorch-version: 1.9 | |
- python-version: 3.10 | |
pytorch-version: 1.10 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade uv | |
uv pip install --system pytest pytest-cov | |
uv pip install --system torch==${{ matrix.pytorch-version }} torchvision transformers | |
- name: mypy | |
if: ${{ matrix.pytorch-version == '2.2' }} | |
run: | | |
uv pip install --system mypy==1.9.0 | |
mypy --install-types --non-interactive . | |
- name: pytest | |
if: ${{ matrix.pytorch-version == '2.2' }} | |
run: | | |
pytest --cov=torchinfo --cov-report= --durations=0 | |
- name: pytest | |
if: ${{ matrix.pytorch-version != '2.2' }} | |
run: | | |
pytest --no-output -k "not test_eval_order_doesnt_matter and not test_google and not test_uninitialized_tensor and not test_input_size_half_precision and not test_recursive_with_missing_layers and not test_flan_t5_small" | |
- name: codecov | |
uses: codecov/codecov-action@v1 |