Skip to content

Commit

Permalink
CI: Rework CI to use conda-installed Python/FSL
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Mar 23, 2024
1 parent 6dcac6e commit e2bca6d
Showing 1 changed file with 45 additions and 36 deletions.
81 changes: 45 additions & 36 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,37 @@ name: Python package
# Set once
env:
SUBPACKAGE: nipype1
FSLCONDA: https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -el {0}

jobs:
devcheck:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.11' ] # Check oldest and newest versions
pip-flags: [ '', '--editable' ]
python-version: ["3.8", "3.12"] # Check oldest and newest versions
pip-flags: ["", "--editable"]
pydra:
- 'pydra'
- '--editable git+https://github.com/nipype/pydra.git#egg=pydra'
- "pydra"
- "--editable git+https://github.com/nipype/pydra.git#egg=pydra"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
Expand All @@ -47,19 +56,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set up NeuroDebian
run: bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
mamba-version: "*"
channels: ${{ env.FSLCONDA }},conda-forge,defaults
channel-priority: true
- name: Install FSL
run: sudo apt-get install -y fsl
- name: Install build dependencies
run: |
mamba install fsl-avwutils
mamba env config vars set FSLDIR="$CONDA_PREFIX"
mamba env config vars set FSLOUTPUTTYPE="NIFTI_GZ"
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install task package
Expand All @@ -69,34 +82,30 @@ jobs:
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
- name: Test with pytest
run: |
source /etc/fsl/fsl.sh
pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \
--cov pydra.tasks.$SUBPACKAGE --cov-report xml
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
if: ${{ always() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

deploy:
needs: [ devcheck, test ]
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install build tools
run: python -m pip install build twine
- name: Build source and wheel distributions
run: python -m build
- name: Check distributions
run: twine check dist/*
- uses: actions/upload-artifact@v2
- uses: hynek/build-and-inspect-python-package@v2

deploy:
needs: [build, devcheck, test]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: distributions
path: dist/
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit e2bca6d

Please sign in to comment.