FIX(register): bug with channels option + FEAT(io/reslice): support s… #608
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: nitorch-test | |
on: | |
workflow_dispatch: | |
inputs: | |
fail-fast: | |
description: 'Fail fast mode' | |
required: false | |
default: 'true' | |
push: | |
paths: | |
# all library files | |
- "nitorch/**" | |
branches: [ master ] | |
pull_request: | |
# always run tests on pull request | |
branches: [ master ] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: ${{ github.event.inputs.fail-fast == 'true' }} | |
matrix: | |
os: [ ubuntu-18.04 ] # we only run tests on ubuntu/cpu | |
python-version: [ '3.6' ] # smallest version supported | |
pytorch-version: [ '1.4', '1.10' ] # smallest and biggest versions | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pip | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
pip install nibabel | |
pip install tifffile | |
- name: Install PyTorch ${{ matrix.pytorch-version }} | |
env: | |
cuda: cpu | |
torch: ${{ matrix.pytorch-version }} | |
shell: bash | |
run: | | |
os="$(cut -d'-' -f1 <<< ${{ matrix.os }})" | |
echo "$os" | |
if [ ! -f "./scripts/actions/install_pytorch_${os}.sh" ]; then | |
echo "pytorch not available on ${os}" | |
exit 1 | |
fi | |
source "./scripts/actions/install_pytorch_${os}.sh" | |
# we must build in development mode for pytest to work in place | |
- name: Build nitorch | |
run: | | |
# install scipy ourselves because setuptools does a poor job | |
pip install scipy | |
# wget needed for io test | |
pip install wget | |
NI_USE_CUDA=0 NI_COMPILED_BACKEND="C" python setup.py develop | |
python -c "from nitorch._C import spatial" | |
NI_SHOW_COMPILED_BACKEND=1 python -c "from nitorch._C import grid" | |
# - name: Lint | |
# run: | | |
# pip install flake8 | |
# flake8 . | |
- name: Tests | |
run: | | |
pip install pytest | |
pytest --ignore nitorch/tests/test_gradcheck_spatial.py |