Skip to content

update: improve tests for testing #3186

update: improve tests for testing

update: improve tests for testing #3186

Workflow file for this run

name: Run Tests
on:
push:
paths:
- 'junifer/**'
- '.github/workflows/**'
pull_request:
paths:
- 'junifer/**'
- '.github/workflows/**'
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Set up system
run: |
bash -c "$(curl -fsSL http://neuro.debian.net/_files/neurodebian-travis.sh)"
sudo apt-get -qq update
sudo apt-get -qq install git-annex-standalone
- name: Configure git for datalad
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Runner"
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install tox tox-gh-actions
- name: Install AFNI
run: |
echo "++ Distro information"
lsb_release -a
echo "++ Add universe repo"
sudo add-apt-repository -y universe
echo "++ Add PPAs for R programs"
sudo add-apt-repository -y "ppa:marutter/rrutter4.0"
sudo add-apt-repository -y "ppa:c2d4u.team/c2d4u4.0+"
echo "++ Update package manager info"
sudo apt-get -qq update
echo "++ Get main dependencies"
sudo apt-get -qq install -y tcsh libssl-dev gsl-bin libjpeg62 vim curl \
build-essential libcurl4-openssl-dev libxml2-dev libgfortran-11-dev \
libgomp1 r-base cmake rsync libxm4
sudo ln -s /usr/lib/x86_64-linux-gnu/libgsl.so.27 /usr/lib/x86_64-linux-gnu/libgsl.so.19
curl -O https://afni.nimh.nih.gov/pub/dist/bin/misc/@update.afni.binaries
sudo tcsh @update.afni.binaries -package linux_ubuntu_16_64 -bindir /afni
echo "/afni" >> $GITHUB_PATH
if: matrix.python-version == 3.12
# Bypass AFNI installation failure
continue-on-error: true
- name: Check AFNI
run: |
echo "Using AFNI : $(afni --version)"
if: matrix.python-version == 3.12
# Bypass AFNI installation failure
continue-on-error: true
- name: Install ANTs
run: |
sudo apt-get install -y -qq unzip
curl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.5.2/ants-2.5.2-ubuntu-22.04-X64-gcc.zip
unzip ants.zip -d /opt
mv /opt/ants-2.5.2/bin/* /opt/ants-2.5.2
rm ants.zip
echo "/opt/ants-2.5.2" >> $GITHUB_PATH
if: matrix.python-version == 3.12
# Bypass ANTs installation failure
continue-on-error: true
- name: Check ANTs
run: |
echo "Using ANTs : $(antsRegistration --version)"
if: matrix.python-version == 3.12
# Bypass ANTs installation failure
continue-on-error: true
- name: Install FSL
run: |
curl -fsSL https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py | python - -d /opt/fsl/ --skip_registration
echo "FSLDIR=/opt/fsl" >> $GITHUB_ENV
echo "FSLOUTPUTTYPE=NIFTI_GZ" >> $GITHUB_ENV
echo "FSLMULTIFILEQUIT=TRUE" >> $GITHUB_ENV
echo "/opt/fsl/bin" >> $GITHUB_PATH
if: matrix.python-version == 3.12
# Bypass FSL installation failure
continue-on-error: true
- name: Check FSL
run: |
echo "Using FSL : $(flirt -version)"
if: matrix.python-version == 3.12
# Bypass FSL installation failure
continue-on-error: true
- name: Test with tox
run: |
tox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: junifer
if: success() && matrix.python-version == 3.12