[pre-commit.ci] pre-commit autoupdate #170
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 workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python package | |
# Set once | |
env: | |
SUBPACKAGE: nipype1 | |
FSLCONDA: https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ | |
NO_ET: 1 # etelemetry causes order-of-magnitude slowdowns | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: | |
- published | |
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.8", "3.12"] # Check oldest and newest versions | |
pip-flags: ["", "--editable"] | |
pydra: | |
- "pydra" | |
- "--editable git+https://github.com/nipype/pydra.git#egg=pydra" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install Pydra | |
run: | | |
pip install ${{ matrix.pydra }} | |
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" | |
- name: Install task package | |
run: | | |
pip install ${{ matrix.pip-flags }} ".[dev]" | |
python -c "import pydra.tasks.$SUBPACKAGE as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" | |
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
mamba-version: "*" | |
channels: ${{ env.FSLCONDA }},conda-forge,defaults | |
channel-priority: true | |
- name: Install FSL | |
run: | | |
mamba install fsl-avwutils | |
mamba env config vars set FSLDIR="$CONDA_PREFIX" FSLOUTPUTTYPE="NIFTI_GZ" | |
# Hack because we're not doing a full FSL install | |
echo "6.0.7.9" > $CONDA_PREFIX/etc/fslversion | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install task package | |
run: | | |
pip install ".[test]" | |
python -c "import pydra.tasks.$SUBPACKAGE as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" | |
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" | |
- name: Test with pytest | |
run: | | |
pytest -sv --doctest-modules --pyargs pydra.tasks.$SUBPACKAGE \ | |
--cov pydra.tasks.$SUBPACKAGE --cov-report xml --cov-report term-missing | |
- uses: codecov/codecov-action@v4 | |
if: ${{ always() }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: hynek/build-and-inspect-python-package@v2 | |
deploy: | |
needs: [build, devcheck, test] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
if: github.repository_owner == 'nipype' && github.event.action == 'published' | |
environment: Publish | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 |