Fix release workflow (#22) #42
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: Tests (Ubuntu) | |
on: | |
push: | |
branches: | |
- main | |
- master | |
paths-ignore: | |
- "doc*/**" | |
- "./*.ya?ml" | |
- "**/*.md" | |
- "**/*.rst" | |
pull_request: | |
paths-ignore: | |
- "doc*/**" | |
- "./*.ya?ml" | |
- "**/*.md" | |
- "**/*.rst" | |
workflow_dispatch: | |
jobs: | |
python: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
torch-version: ["1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1", "2.4.1", "2.5.1"] | |
exclude: | |
# Check latest versions here: https://download.pytorch.org/whl/torch/ | |
# | |
# PyTorch issues: | |
# 3.11: https://github.com/pytorch/pytorch/issues/86566 | |
# 3.12: https://github.com/pytorch/pytorch/issues/110436 | |
# 3.13: https://github.com/pytorch/pytorch/issues/130249 | |
# | |
# PyTorch<2.2.0 does only support Python<3.12 (all platforms) | |
- python-version: "3.12" | |
torch-version: "1.11.0" | |
- python-version: "3.12" | |
torch-version: "1.12.1" | |
- python-version: "3.12" | |
torch-version: "1.13.1" | |
- python-version: "3.12" | |
torch-version: "2.0.1" | |
- python-version: "3.12" | |
torch-version: "2.1.2" | |
# PyTorch<1.13.0 does only support Python<3.11 (Linux) | |
- python-version: "3.11" | |
torch-version: "1.11.0" | |
- python-version: "3.11" | |
torch-version: "1.12.1" | |
# PyTorch>=2.5.0 does not support Python<3.9 | |
- python-version: "3.8" | |
torch-version: "2.5.1" | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Debug print | |
run: | | |
pwd | |
ls -lcahF | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y libblas-dev | |
python3 -m pip install --upgrade pip | |
python3 -m pip install tox | |
- name: Determine TOXENV | |
run: echo "TOXENV=py$(echo ${{ matrix.python-version }} | tr -d '.')-torch$(echo ${{ matrix.torch-version }} | tr -d '.')" >> $GITHUB_ENV | |
- name: Print TOXENV | |
run: echo "TOXENV is set to '${TOXENV}'." | |
env: | |
TOXENV: ${{ env.TOXENV }} | |
- name: Unittests with tox | |
run: tox -e $TOXENV | |
env: | |
TOXENV: ${{ env.TOXENV }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # 5.1.1 | |
if: > | |
matrix.python-version == '3.11' && | |
matrix.torch-version == '2.2.2' && | |
matrix.os == 'ubuntu-latest' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml # optional |