-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI-Tests | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
branches: | ||
- master | ||
push: | ||
pull_request: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- 'macos-10.15' | ||
- 'macos-11.0' | ||
- 'windows-2019' | ||
- 'ubuntu-18.04' | ||
- 'ubuntu-20.04' | ||
- 'ubuntu-16.04' | ||
python-version: | ||
- '3.7' | ||
- '3.8' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set XCode version | ||
if: contains(matrix.os, 'macos-11.0') | ||
run: sudo xcode-select -s "/Applications/Xcode_12.2.app" | ||
|
||
- name: Run CI script | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
run: ./ci.sh | ||
# Add test coverage stats to Coveralls.io | ||
finish: | ||
needs: test | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
parallel-finished: true |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Installation of dependencies" | ||
|
||
# Install bleeding-edge dcm2niix | ||
curl -JLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip | ||
unzip -o dcm2niix_lnx.zip | ||
sudo install dcm2nii* /usr/bin/ | ||
|
||
echo "shimming-toolbox installation" | ||
pip install . | ||
pip install coveralls | ||
|
||
# Tests | ||
echo "Download prelude" | ||
st_download_data prelude | ||
echo "Set up prelude" | ||
prelude_path="$(pwd)"/prelude | ||
chmod 500 "${prelude_path}"/prelude | ||
PATH=${prelude_path}:${PATH} | ||
export PATH | ||
FSLOUTPUTTYPE=NIFTI_GZ | ||
export FSLOUTPUTTYPE | ||
echo "Launch general integrity test" | ||
py.test . -v --cov shimmingtoolbox/ --cov-report term-missing | ||
|
||
# Fail if any .sh files have warnings | ||
echo "Check Bash scripts" | ||
if [[ -n "$(ls examples/*.sh)" ]]; then shellcheck examples/*.sh; fi |