quick fix #974
Workflow file for this run
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 workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python package | |
on: | |
push: | |
# branches: [ main ] | |
# pull_request: | |
# branches: [ main ] | |
jobs: | |
quality: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-3.8 | |
restore-keys: ${{ runner.os }}-pip-3.8 | |
- name: Install non-python dependencies | |
run: | | |
sudo apt-get install -y graphviz-dev | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-3.8 | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# run python style checks | |
#---------------------------------------------- | |
- name: isort | |
run: poetry run isort hippunfold/*.py -c | |
- name: Black | |
run: poetry run black hippunfold --check | |
- name: snakefmt | |
run: poetry run snakefmt hippunfold --check | |
test: | |
runs-on: ubuntu-latest | |
needs: [ 'quality' ] | |
strategy: | |
matrix: | |
python-version: ['3.7', '3.8'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }} | |
restore-keys: ${{ runner.os }}-pip-${{ matrix.python-version }} | |
- name: Install non-python dependencies | |
run: | | |
sudo apt-get install -y graphviz-dev | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
- name: Set-up env for hippunfold | |
run: | | |
echo "HIPPUNFOLD_CACHE_DIR=`pwd`/test_data/fake_models" >> $GITHUB_ENV | |
- name: Test single T2w bids | |
run: | | |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w | |
- name: Test single T2w bids, right hemi | |
run: | | |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi R | |
- name: Test single T2w bids, left hemi | |
run: | | |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi L | |
- name: Test multiple T2w bids | |
run: | | |
poetry run hippunfold test_data/bids_multiT2w test_out participant -np --modality T2w | |
- name: Test T1w bids | |
run: | | |
poetry run hippunfold test_data/bids_T1w test_out participant -np --modality T1w | |
- name: Test hipp b500 bids | |
run: | | |
poetry run hippunfold test_data/bids_hippb500 test_out participant -np --modality hippb500 | |
- name: Test T1w multi-session/longitudinal bids | |
run: | | |
poetry run hippunfold test_data/bids_T1w_longitudinal test_out participant -np --modality T1w | |
- name: Test single T2w multi-session/longitudinal bids | |
run: | | |
poetry run hippunfold test_data/bids_singleT2w_longitudinal test_out participant -np --modality T2w | |
- name: Test manual seg T2w bids | |
run: | | |
poetry run hippunfold test_data/bids_segT2w test_out participant -np --modality segT2w | |
- name: Test cropseg bids, with path override | |
run: | | |
poetry run hippunfold - test_out participant -np --modality cropseg --path_cropseg test_data/data_cropseg/sub-{subject}_hemi-{hemi}_dseg.nii.gz | |
- name: Test cropseg bids, with path override, left hemi | |
run: | | |
poetry run hippunfold - test_out participant -np --modality cropseg --path_cropseg test_data/data_cropseg_1hemi/sub-{subject}_hemi-{hemi}_dseg.nii.gz --hemi L | |
- name: Test T2w with T1w template registration | |
run: | | |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --t1_reg_template | |
- name: Test T2w with T1w output space | |
run: | | |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --output_space T1w | |