[pre-commit.ci] pre-commit autoupdate (#291) #422
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.7", "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"] | |
include: | |
- python-version: 3.11 | |
pytorch-version: 2.0 | |
- python-version: 3.11 | |
pytorch-version: 2.1 | |
exclude: | |
- python-version: 3.7 | |
pytorch-version: 1.11 | |
- python-version: 3.7 | |
pytorch-version: 1.12 | |
- python-version: 3.7 | |
pytorch-version: 1.13 | |
- python-version: 3.7 | |
pytorch-version: 2.0 | |
- python-version: 3.7 | |
pytorch-version: 2.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.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 pip | |
python -m pip install pytest pytest-cov | |
pip install torch==${{ matrix.pytorch-version }} torchvision transformers | |
pip install compressai | |
- name: mypy | |
if: ${{ matrix.pytorch-version == '2.1' }} | |
run: | | |
python -m pip install mypy==1.7.1 | |
mypy --install-types --non-interactive . | |
- name: pytest | |
if: ${{ matrix.pytorch-version == '2.1' }} | |
run: | | |
pytest --cov=torchinfo --cov-report= --durations=0 | |
- name: pytest | |
if: ${{ matrix.pytorch-version != '2.1' }} | |
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 |