Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OS coverage workflow #175

Merged
merged 5 commits into from Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 36 additions & 26 deletions .github/workflows/os-coverage.yml
Expand Up @@ -7,38 +7,48 @@ jobs:
strategy:
fail-fast: true
max-parallel: 15

matrix:
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-latest]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
exclude:
# temporary exclusion until py3.8 deps work on Windows
- python-version: 3.7
os: windows-2019
- python-version: 3.8
os: windows-2019

- python-version: '3.7'
os: windows-latest # https://pytorch.org/get-started/locally/#windows-python (actually 3.7 seems to be the problem)
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-pip-wheels
uses: actions/cache@v3
with:
path: ~/.cache
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies # hack for 🐛: don't let poetry try installing Torch https://github.com/pytorch/pytorch/issues/88049
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
source $HOME/.poetry/env
python -m pip install --upgrade --user pip
pip install pytest pytest-cov
poetry lock
poetry build
poetry install
poetry run pip install 'setuptools==59.5.0'
# pinning setuptools is a temporary fix to: pytorch-lightning 1.5.10 requires setuptools==59.5.0
# supposedly poetry allows pinning ver. of setuptools in pyproject.ml files but it is not working atm https://github.com/python-poetry/poetry/issues/4511

- name: Run tests
pip install pytest pytest-cov papermill poethepoet>=0.10.0
pip install torch>=1.8.1 torchvision pytorch-lightning scikit-learn torchsde torchcde>=0.2.3 scipy matplotlib ipykernel ipywidgets
poetry install --only-root
poetry run pip install setuptools
- name: Run pytest checks
run: |
source $HOME/.poetry/env
source $VENV
poetry run coverage run --source=torchdyn -m pytest
- name: Report coverage
uses: codecov/codecov-action@v3.1.1
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -13,7 +13,7 @@ python = "^3.7"
torch = "^1.8.1"
torchsde="*"
torchcde="^0.2.3"
sklearn = "*"
scikit-learn = "*"
pytorch-lightning = "*"
torchvision = "*"
scipy = "*"
Expand Down