also set smaps for non 2D case. #357
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
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to | |
# help test this project | |
name: Test | |
on: | |
pull_request: | |
branches: ["main"] | |
push: | |
branches: ["main"] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python: ['3.10' , '3.12'] | |
platform: ["gpu"] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
export CUDA_BIN_PATH=/usr/local/cuda-12.1/ | |
export PATH=/usr/local/cuda-12.1/bin/:${PATH} | |
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64/:${LD_LIBRARY_PATH} | |
python -m pip install --upgrade pip | |
pip install cufinufft cupy-cuda12x finufft ipywidgets | |
pip install -e .[test,toolkit] | |
- name: Test | |
run: | | |
pytest tests --cov --cov-branch --cov-report=term | |
test-examples: | |
runs-on: "gpu" | |
strategy: | |
matrix: | |
python: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Restore cached brainweb-dl directory | |
uses: actions/cache/restore@v4 | |
id: cache-restore | |
with: | |
path: ~/.cache/brainweb | |
key: ${{ runner.os }}-Brainweb | |
- name: Install dependencies | |
run: | | |
export CUDA_BIN_PATH=/usr/local/cuda-12.1/ | |
export PATH=/usr/local/cuda-12.1/bin/:${PATH} | |
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64/:${LD_LIBRARY_PATH} | |
python -m pip install --upgrade pip | |
pip install cufinufft cupy-cuda12x finufft ipywidgets | |
pip install -e .[test,toolkit] | |
- name: Test | |
run: | | |
pytest examples/anatomical | |
- name: Cache brainweb-dl directory | |
uses: actions/cache/save@v4 | |
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} | |
with: | |
path: ~/.cache/brainweb | |
key: ${{ runner.os }}-Brainweb | |
linters: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[toolkit] | |
pip install ruff | |
- name: Linters | |
run: | | |
ruff check src | |
ruff format --check src | |
- name: Annotate locations with typos | |
if: always() | |
uses: codespell-project/codespell-problem-matcher@v1 | |
- name: Codespell | |
if: always() | |
uses: codespell-project/actions-codespell@v2 |