Run notebooks #32
This file contains hidden or 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
| name: Run notebooks | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1' # Every Monday at 00:00 UTC | |
| # Allow job to be triggered manually from GitHub interface | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| # Force tox and pytest to use color | |
| env: | |
| FORCE_COLOR: true | |
| TEST_DATA_HOME: /home/runner/nifreeze-tests/ | |
| NIFREEZE_WERRORS: 1 | |
| TEST_DATA_REPO: https://gin.g-node.org/nipreps-data/tests-nifreeze | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| run-notebooks: | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| python-version: ['3.12'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Check for nvcc and set CUDA flag | |
| id: detect-cuda | |
| run: | | |
| if command -v nvcc &> /dev/null; then | |
| echo "nvcc found: CUDA is available" | |
| echo "HAS_CUDA=true" >> $GITHUB_ENV | |
| else | |
| echo "nvcc not found: CUDA is not available" | |
| echo "HAS_CUDA=false" >> $GITHUB_ENV | |
| fi | |
| - name: Install AFNI | |
| run: | | |
| # Detect Ubuntu version | |
| UBUNTU_VERSION=$(lsb_release -rs | cut -d. -f1) | |
| AFNI_PACKAGE="linux_ubuntu_${UBUNTU_VERSION}_64" | |
| echo "Detected Ubuntu version: $UBUNTU_VERSION" | |
| echo "Using AFNI package: $AFNI_PACKAGE" | |
| # Install dependencies | |
| sudo apt-get update | |
| sudo apt-get install -y tcsh curl libglu1-mesa libxmu6 libxm4 libgsl-dev libglw1-mesa | |
| # Download and install AFNI | |
| curl -O https://afni.nimh.nih.gov/pub/dist/bin/${AFNI_PACKAGE}/@update.afni.binaries | |
| tcsh @update.afni.binaries -package $AFNI_PACKAGE -do_extras | |
| # Add AFNI to PATH | |
| echo "$HOME/abin" >> $GITHUB_PATH | |
| - name: Install TeX Live | |
| run: | | |
| sudo apt-get update | |
| sudo apt install texlive texlive-latex-extra texlive-fonts-recommended cm-super dvipng | |
| - name: Install git-annex | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y git-annex | |
| - name: Configure Git user for DataLad | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "nipreps-bot" | |
| - name: Install DataLad | |
| run: pip install datalad | |
| - name: Create test data directory | |
| run: mkdir ${TEST_DATA_HOME} | |
| - name: Download data from OpenNeuro | |
| run: | | |
| ${{ github.workspace }}/scripts/fetch_fmri_nb_openneuro_data.sh "${TEST_DATA_HOME}" | |
| - name: Download data from OSF | |
| run: | | |
| pip install osfclient | |
| osf -p 39k4x fetch hcpdata.npz "${TEST_DATA_HOME}/hcpdata.npz" | |
| - name: Download SynthStrip model | |
| run: | | |
| wget https://ftp.nmr.mgh.harvard.edu/pub/dist/freesurfer/synthstrip/models/synthstrip.1.pt -P "${TEST_DATA_HOME}" | |
| - name: Install tox | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Run notebooks with tox | |
| run: tox -e notebooks |