Skip to content

Commit

Permalink
Move 3rd-party dep installation to GH Workflow
Browse files Browse the repository at this point in the history
**Why this change was necessary**
Different versions of the 3rd-party dependencies are needed for
macOS. Conditionally installing software based on OS is much easier to
manage in the GH Actions workflow than in a shell script.

**What this change does**
Move prelude and dcm2niix installation steps to the GH Workflow.
  • Loading branch information
jidicula committed Nov 30, 2020
1 parent a745004 commit d70bc78
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,26 @@ jobs:
if: contains(matrix.os, 'macos')
run: brew install dcm2niix

- name: dcm2niix Linux
- name: dcm2niix Ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
curl -JLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip || exit "$?"
unzip -o dcm2niix_lnx.zip || exit "$?"
sudo install dcm2nii* /usr/bin/ || exit "$?"
- 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 || exit "$?"
- name: prelude Ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
echo "Download prelude"
st_download_data prelude || exit "$?"
- name: Run CI script
run: ./ci.sh

Expand Down
9 changes: 4 additions & 5 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

echo "Installation of dependencies"


# Tests
echo "Download prelude"
st_download_data prelude || exit "$?"
# Dependencies
echo "Set up prelude"
prelude_path="$(pwd)"/prelude
chmod 500 "${prelude_path}"/prelude
chmod +x "${prelude_path}"/prelude
PATH=${prelude_path}:${PATH}
export PATH
FSLOUTPUTTYPE=NIFTI_GZ
export FSLOUTPUTTYPE
echo "$PATH"
st_check_dependencies || exit "$?"

# Unit tests
echo "Launch general integrity test"
py.test . -v --cov shimmingtoolbox/ --cov-report term-missing || exit "$?"

0 comments on commit d70bc78

Please sign in to comment.