Skip to content

Add unwrap CLI

Add unwrap CLI #1284

Workflow file for this run

name: CI-Tests
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
env:
FSLOUTPUTTYPE: NIFTI_GZ
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- 'macos-12'
- 'macos-13'
- 'ubuntu-22.04'
- 'ubuntu-20.04'
python-version:
- '3.9'
steps:
- name: Get home directory
run: |
echo ~
echo $HOME
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Package installation
run: |
echo "shimming-toolbox installation"
make install
- name: Set path for Shimming Toolbox
run: |
echo "$HOME/shimming-toolbox/bin" >> $GITHUB_PATH
- name: Spinal Cord Toolbox clone
run: |
cd ~/work
git clone --depth 1 https://github.com/neuropoly/spinalcordtoolbox
cd spinalcordtoolbox
# Use HEAD commit hash as key for cache
git rev-parse HEAD > $GITHUB_WORKSPACE/.sct_HEAD_hash
cat $GITHUB_WORKSPACE/.sct_HEAD_hash
- name: Cache SCT
id: cache-sct
uses: actions/cache@v2
with:
path: ~/work/spinalcordtoolbox
# Use commit hash file from previous step as key
key: ${{ matrix.os }}-${{ hashFiles('**/.sct_HEAD_hash') }}
- name: Spinal Cord Toolbox installation
if: steps.cache-sct.outputs.cache-hit != 'true'
run: |
cd ../../spinalcordtoolbox
./install_sct -y
- name: Set path for SCT
run: echo "$HOME/work/spinalcordtoolbox/bin" >> $GITHUB_PATH
- name: prelude macOS
if: contains(matrix.os, 'macos')
run: |
echo "Download prelude for macOS"
mkdir prelude
curl -o prelude/prelude -JL https://github.com/shimming-toolbox/binaries/raw/master/prelude_macos
sudo install prelude/prelude /usr/local/bin
- name: prelude Ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
echo "Download prelude"
st_download_data prelude
sudo install prelude/prelude /usr/local/bin
- name: Check dependencies
run: st_check_dependencies
- name: Run unit tests
run: |
source ~/shimming-toolbox/python/bin/activate # to be able to call conda
py.test . -v --cov shimmingtoolbox/ --cov-report term-missing
- name: macOS Shellcheck
if: contains(matrix.os, 'macos')
run: brew install shellcheck
- name: Shellcheck
run: |
echo "Check Bash scripts"
if [[ -n "$(ls examples/*.sh)" ]]; then shellcheck examples/*.sh; fi
- name: Upload Coverage
run: |
pip3 install coveralls
coveralls --service=github --rcfile=.coveragerc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.os }}-Python-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
name: Finish Coveralls
needs: test
runs-on: 'ubuntu-22.04'
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish --rcfile=.coveragerc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}